Closed Bug 1123471 Opened 9 years ago Closed 9 years ago

Create basic browser-chrome test for reader mode toolbar button

Categories

(Firefox :: General, defect)

defect
Not set
normal
Points:
3

Tracking

()

RESOLVED FIXED
Firefox 38
Iteration:
38.2 - 9 Feb

People

(Reporter: Margaret, Assigned: Margaret)

References

Details

Attachments

(1 file, 1 obsolete file)

Follow-up to bug 795981.

I think we should start with a simple browser-chrome test that flips the parse-on-load pref, loads a reader-mode-able page, and then checks that the button is visible. Then after that we could also click the button and make sure about:reader loads correctly.
Points: --- → 3
Flags: qe-verify-
Flags: in-testsuite?
Flags: firefox-backlog+
/r/2963 - Bug 1123471 - Create basic browser-chrome test for reader mode toolbar button. r=jaws

Pull down this commit:

hg pull review -r 7482e9597b71dc422622d14bdc2cbffea60e225d
Attachment #8553963 - Flags: review?(jaws)
There's a lot more I could add here, but I'm starting simple :)

Things I want to test next:
* Reader mode button properly appears/disappears when switching tabs
* Clicking on reader mode button shows about:reader
* Clicking on reader mode button again toggles back to original page
* about:reader page has correct content (at the very least just check something like header text)
Updated to do some more checks. I still have to figure out how I would test the content of the page, since that will probably require a content script.

(Using an old-school patch because MozReview doesn't like single commits based on top of other unpublished changes.)

Try run: https://treeherder.mozilla.org/#/jobs?repo=try&revision=0e7b1875cd11
Attachment #8553963 - Attachment is obsolete: true
Attachment #8553963 - Flags: review?(jaws)
Attachment #8555848 - Flags: review?(jaws)
Attachment #8555848 - Attachment description: reate basic browser-chrome test for reader mode toolbar button → Create basic browser-chrome test for reader mode toolbar button
Comment on attachment 8555848 [details] [diff] [review]
Create basic browser-chrome test for reader mode toolbar button

Review of attachment 8555848 [details] [diff] [review]:
-----------------------------------------------------------------

::: browser/base/content/test/general/browser_readerMode.js
@@ +44,5 @@
> +  yield promiseWaitForCondition(() => readerButton.hidden);
> +  is_element_hidden(readerButton, "Reader mode button is not present on a non-reader-able page");
> +
> +  // Switch back to the original tab to make sure reader mode button is still visible.
> +  gBrowser.removeCurrentTab();

This is mostly fine but if there is an exception between the addTab on line 42 and this removeCurrentTab() then the test will end with an extra tab. Can you modify the test cleanup function to keep removing tabs until only the original tab is left? That will cover cases where the test bails before this line is reached.
Attachment #8555848 - Flags: review?(jaws) → review+
https://hg.mozilla.org/mozilla-central/rev/34cada2f7c27
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 38
Iteration: --- → 38.2 - 9 Feb
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: