Closed Bug 934678 Opened 12 years ago Closed 12 years ago

Write test for Home.banner API

Categories

(Firefox for Android Graveyard :: General, defect)

ARM
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 28

People

(Reporter: Margaret, Assigned: Margaret)

References

Details

Attachments

(1 file)

Inspired by wesj's comment in bug 932830. I'm thinking we could model this test after testPromptGridInput. We could load a chrome-privledged JS file that adds a home banner message, then open about:home and check to make sure the banner is shown.
Attached patch patchSplinter Review
This is pretty simple, but it gets the job done. Here's a try push: https://tbpl.mozilla.org/?tree=Try&rev=60e19162debe
Attachment #827118 - Flags: review?(wjohnston)
Comment on attachment 827118 [details] [diff] [review] patch Review of attachment 827118 [details] [diff] [review]: ----------------------------------------------------------------- Great! ::: mobile/android/base/tests/roboextender/robocop_home_banner.html @@ +14,5 @@ > +const TEXT = "The quick brown fox jumps over the lazy dog."; > + > +function start() { > + var test = location.hash.substring(1); > + window[test](); Since there's only one test in here, you could just call addMessage() directly.
Attachment #827118 - Flags: review?(wjohnston) → review+
(In reply to Wesley Johnston (:wesj) from comment #2) > ::: mobile/android/base/tests/roboextender/robocop_home_banner.html > @@ +14,5 @@ > > +const TEXT = "The quick brown fox jumps over the lazy dog."; > > + > > +function start() { > > + var test = location.hash.substring(1); > > + window[test](); > > Since there's only one test in here, you could just call addMessage() > directly. I originally wanted to make a removeMessage method as well, but I didn't know the best way to store the message id, since the page would get reloaded. Maybe in a pref, since this is chrome-privileged? I'd also want to do a check in Java to make sure we *didn't* show the message, and I'm not sure of a better way than waiting for a waitForText to time out.
Depends on: 935264
I decided to leave in the addMessage function bit, and filed bug 935264 about extending this to test Home.banner.remove(). https://hg.mozilla.org/integration/fx-team/rev/b79bb3ab6ca2
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 28
Blocks: home-banner
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: