-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Bug 1188926 - Make all the apps have an manifestURL as well as a name and check for that #31259
Conversation
@@ -12,6 +12,7 @@ | |||
class Contacts(Base): | |||
|
|||
name = "Contacts" | |||
origin_app_name = 'communications/contacts' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is going to work. I think this should be origin_app_name = 'communications'
edit: this was obsolete |
@@ -10,6 +10,7 @@ | |||
class Search(Base): | |||
|
|||
name = 'Browser' | |||
origin_app_name = 'search' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is still 'browser', actually.
However, this stuff doesn't seem to be used at all, currently.
Edit: oh, perhaps this is correct.
@@ -32,7 +33,7 @@ def launch(self): | |||
*self._settings_button_locator)))) | |||
|
|||
def switch_to_contacts_frame(self): | |||
Wait(self.marionette).until(lambda m: self.apps.displayed_app.name == self.name) | |||
Wait(self.marionette).until(lambda m: self.apps.displayed_app.origin_app_name == self.origin_app_name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, you should use .origin here (and everywhere else).
So like this:
Wait(self.marionette).until(lambda m: self.apps.displayed_app.origin == self.origin)
Wait(self.marionette).until( | ||
lambda m: self.apps.displayed_app.name == 'Contacts') | ||
lambda m: self.apps.displayed_app.region == Contacts.region) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uh, why are you using .region here? You need to use .origin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, sorry I don't know why I wrote it wrong :/ I'll fix it now
@@ -373,12 +373,14 @@ var GaiaApps = { | |||
} | |||
|
|||
let origin = app.origin; | |||
console.log('app with origin \'' + origin + '\' is displayed'); | |||
let manifest_url = app.manifest_url; | |||
console.log('app with origin and manifest url \'' + origin + manifest_url + '\' is displayed'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I would remove the origin part here.
And I would remove the variable declarations of origin here and just use app.origin and app.manifest_url directly.
let result = { | ||
frame: (app.browser) ? app.browser.element : app.frame.firstChild, | ||
src: (app.browser) ? app.browser.element.src : app.iframe.src, | ||
name: app.name, | ||
origin: origin | ||
origin: app.manifest_url, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be app.origin
@@ -38,7 +38,7 @@ def test_call_log_all_calls(self): | |||
self.phone.make_call_and_hang_up(test_phone_number) | |||
|
|||
# Wait for fall back to phone app | |||
self.wait_for_condition(lambda m: self.apps.displayed_app.name == self.phone.name) | |||
self.wait_for_condition(lambda m: self.apps.displayed_app.manifest_url == self.phone.manifest_url) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can use self.phone.wait_to_be_displayed() here.
@@ -40,7 +40,8 @@ def tap_back_button(self): | |||
header.tap(x=20) | |||
|
|||
# wait for the frame to close | |||
Wait(self.marionette).until(lambda m: self.apps.displayed_app.name != 'Gallery') | |||
from gaiatest.apps.Gallery.app import Gallery |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need this line, I think.
@@ -91,7 +91,8 @@ def launch(self): | |||
expected.element_present(*self._bluetooth_l10n_locator)) | |||
|
|||
def switch_to_settings_app(self): | |||
Wait(self.marionette).until(lambda m: self.apps.displayed_app.name == self.name) | |||
Wait(self.marionette).until( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: self.wait_to_be_displayed()
@@ -87,7 +87,7 @@ def tap_select_button(self): | |||
self.tap_element_from_system_app(select) | |||
|
|||
# Fall back to app beneath the picker | |||
Wait(self.marionette).until(lambda m: self.apps.displayed_app.name != self.name) | |||
self.apps.wait_to_not_be_displayed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this should be self.apps.wait_to_not_be_displayed()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's to not be, so it should be to_be @mwargers ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, you just need to add "()" to the method.
@@ -16,9 +16,8 @@ class ViewImage(Base): | |||
|
|||
def __init__(self, marionette): | |||
Base.__init__(self, marionette) | |||
Wait(self.marionette).until(lambda m: self.apps.displayed_app.name == 'Gallery') | |||
self.wait_to_be_displayed() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be Gallery(self.marionette).wait_to_be_displayed()? (and do the gallery import before that then, of course).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're already in the constructor of Gallery. Doing Gallery(self.marionette).wait_to_be_displayed()
will provoke a endless loop. self.wait_to_be_displayed()
is absolutely fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, how does that work then? I don't understand.
I see mentions of view_image here: http://mxr.mozilla.org/gaia/search?string=view_image
Nothing seems related to Gallery.
But I guess because this file is in a subdirectory of galllery, it somehow is the constructor of Gallery?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh! I misread the class we're in. You're absolutely right, Martijn!
No description provided.