This document contains a simple preliminary description of testcases on History interface of Webclient API.

- Tests on back method
- Tests on canBack method
- Tests on canForward method
- Tests on clearHistory method
- Tests on forward method
- Tests on getBackList method
- Tests on getCurrentHistoryIndex method
- Tests on getForwardList method
- Tests on getHistory method
- Tests on getHistoryEntry method
- Tests on getHistoryLength method
- Tests on getURLForIndex method
- Tests on setCurrentHistoryIndex method

## 1. Tests on back method.

Test ID | Action | Expected Result
basic/api/History_back_1:0 | Method back() invoked when backList is empty | Mozilla doesn't crashes and no page loads
basic/api/History_back_1:1 | Method back() invoked when backList is not empty | Mozilla doesn't crashes and load previous page
basic/api/History_back_2:0 | Method back() invoked when no URL loaded | Mozilla doesn't crashes and no page loads

## 2. Tests on canBack method.

Test ID | Action | Expected Result
basic/api/History_canBack_1:0 | Method canBack() invoked when backList is not empty | Mozilla doesn't crashes and canBack return true
basic/api/History_canBack_1:1 | Method canBack() invoked when backList is empty | Mozilla doesn't crashes and canBack return false
basic/api/History_canBack_2:0 | Method canBack() invoked when no URL loaded | Mozilla doesn't crashes and canBack return false

## 3. Tests on canForward method.

Test ID | Action | Expected Result
basic/api/History_canForward_1:0 | Method canForward() invoked when forwardList is not empty | Mozilla doesn't crashes and canForward return true
basic/api/History_canForward_1:1 | Method canForward() invoked when forwardList is empty | Mozilla doesn't crashes and canForward return false
basic/api/History_canForward_2:0 | Method canForward() invoked when no URL loaded | Mozilla doesn't crashes and canForward return false

## 4. Tests on clearHistory method.

Test ID | Action | Expected Result
basic/api/History_clearHistory_1:0 | Method clearHistory() invoked when no URL loaded | Mozilla doesn't crashes and history.length return true
basic/api/History_clearHistory_2:0 | Method clearHistory() invoked when some URL's are loaded | Mozilla doesn't crashes and clearHistory return false

## 5. Tests on forward method.

Test ID | Action | Expected Result
basic/api/History_forward_1:0 | Method forward() invoked when forwardList is empty | Mozilla doesn't crashes and forward do nothing and do not thrown any exception
basic/api/History_forward_1:1 | Method forward() invoked when forwardList is not empty | Mozilla doesn't crashes and forward load next URL
basic/api/History_forward_2:0 | Method forward() invoked when no URL loaded | Mozilla doesn't crashes and forward do nothing and do not thrown any exception

## 6. Tests on getBackList method.

Test ID | Action | Expected Result
basic/api/History_getBackList:0 | Method getBackList() invoked when backList is empty | Mozilla doesn't crashes and getBackList return null
basic/api/History_getBackList:1 | Method getBackList() invoked when backList is not empty | Mozilla doesn't crashes and getBackList return correct backList
basic/api/History_getBackList:2 | Method getBackList() invoked when no URL loaded | Mozilla doesn't crashes and getBackList return null
basic/api/History_getBackList:3 | Method getBackList() invoked when some URL's are loaded and neither method called before | Mozilla doesn't crashes and getBackList return correct BackList

## 7. Tests on getCurrentHistoryIndex method.

Test ID | Action | Expected Result
basic/api/History_getCurrentHistoryIndex:0 | Method getCurrentHistoryIndex() invoked when current URL is the first in history | Mozilla doesn't crashes and getCurrentHistoryIndex return 0
basic/api/History_getCurrentHistoryIndex:1 | Method getCurrentHistoryIndex() invoked when current URL is the last in history | Mozilla doesn't crashes and getCurrentHistoryIndex return correct length of history
basic/api/History_getCurrentHistoryIndex:2 | Method getCurrentHistoryIndex() invoked when current URL is in the middle of history | Mozilla doesn't crashes and getCurrentHistoryIndex return correct index
basic/api/History_getCurrentHistoryIndex:3 | Method getCurrentHistoryIndex() invoked when current URL is the last in history and neither method called before | Mozilla doesn't crashes and getCurrentHistoryIndex return correct index

## 8. Tests on getForwardList method.

Test ID | Action | Expected Result
basic/api/History_getForwardList:0 | Method getForwardList() invoked when forwardList is empty (the last page is loaded) | Mozilla doesn't crashes and getForwardList return empty array
basic/api/History_getForwardList:1 | Method getForwardList() invoked when forwardList is equal all history | Mozilla doesn't crashes and getForwardList return correct forwardList
basic/api/History_getForwardList:2 | Method getForwardList() invoked when forwardList is a part of history | Mozilla doesn't crashes and getForwardList return correct forwardList
basic/api/History_getForwardList:3 | Method getForwardList() invoked when forwardList is empty (the last page is loaded) and neither method called before | Mozilla doesn't crashes and getForwardList return correct forwardList

## 9. Tests on getHistory method.

Test ID | Action | Expected Result
basic/api/History_getHistory_1:0 | Method getHistory() invoked when history contains only 1 html | Mozilla doesn't crashes and getHistory return araay with 1 element
basic/api/History_getHistory_2:0 | Method getHistory() invoked when current page is the first in history | Mozilla doesn't crashes and getHistory return correct array
basic/api/History_getHistory_2:1 | Method getHistory() invoked when current page in the middle of history | Mozilla doesn't crashes and getHistory return correct array
basic/api/History_getHistory_2:2 | Method getHistory() invoked when current page in the end of history | Mozilla doesn't crashes and getHistory return correct array

## 10. Tests on getHistoryEntry method.

Test ID | Action | Expected Result
basic/api/History_getHistoryEntry:0 | Method getHistoryEntry() invoked with arg = INTEGER.MAX_VALUE | Mozilla doesn't crashes and getHistoryEntry return null (or thrown Exception)
basic/api/History_getHistoryEntry:1 | Method getHistoryEntry() invoked with arg = INTEGER.MIN_VALUE | Mozilla doesn't crashes and getHistoryEntry return null (or thrown Exception)
basic/api/History_getHistoryEntry:2 | Method getHistoryEntry() invoked with arg = 0 | Mozilla doesn't crashes and getHistoryEntry return a first entry of history
basic/api/History_getHistoryEntry:3 | Method getHistoryEntry() invoked with arg equals a history.length | Mozilla doesn't crashes and getHistoryEntry return last entry of history

## 11. Tests on getHistoryLength method.

Test ID | Action | Expected Result
basic/api/History_getHistoryLength_1:0 | Method getHistoryLength() invoked with some loaded pages | Mozilla doesn't crashes and getHistoryLength return correct value
basic/api/History_getHistoryLength_2:0 | Method getHistoryLength() invoked when none URL's loaded | Mozilla doesn't crashes and getHistoryLength return 0

## 12. Tests on getURLForIndex method.

Test ID | Action | Expected Result
basic/api/History_getURLForIndex:0 | Method getURLForIndex() invoked with arg = INTEGER.MAX_VALUE | Mozilla doesn't crashes and getURLForIndex return null (or thrown Exception)
basic/api/History_getURLForIndex:1 | Method getURLForIndex() invoked with arg = INTEGER.MIN_VALUE | Mozilla doesn't crashes and getURLForIndex return null (or thrown Exception)
basic/api/History_getURLForIndex:2 | Method getURLForIndex() invoked with arg = 0 | Mozilla doesn't crashes and getURLForIndex return a first URL of history
basic/api/History_getURLForIndex:3 | Method getURLForIndex() invoked with arg equals a history.length | Mozilla doesn't crashes and getURLForIndex return last URL of history

## 13. Tests on setCurrentHistoryIndex method.

Test ID | Action | Expected Result
basic/api/History_setCurrentHistoryIndex_1:0 | Method setCurrentHistoryIndex() invoked with arg = INTEGER.MAX_VALUE | Mozilla doesn't crashes and setCurrentHistoryIndex do not load any URL (or thrown Exception)
basic/api/History_setCurrentHistoryIndex_1:1 | Method setCurrentHistoryIndex() invoked with arg = INTEGER.MIN_VALUE | Mozilla doesn't crashes and setCurrentHistoryIndex do not load any URL (or thrown Exception)
basic/api/History_setCurrentHistoryIndex_1:2 | Method setCurrentHistoryIndex() invoked with arg = 0 | Mozilla doesn't crashes and setCurrentHistoryIndex load a first URL of history
basic/api/History_setCurrentHistoryIndex_1:3 | Method setCurrentHistoryIndex() invoked with 0<arg<history.length | Mozilla doesn't crashes and setCurrentHistoryIndex load correct URL
basic/api/History_setCurrentHistoryIndex_1:4 | Method setCurrentHistoryIndex() invoked with arg = history.length | Mozilla doesn't crashes and setCurrentHistoryIndex load last URL of history
basic/api/History_setCurrentHistoryIndex_2:0 | Method setCurrentHistoryIndex() invoked with history = null | Mozilla doesn't crashes and setCurrentHistoryIndex do not load any URL