Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Bug 1188926 - Make all the apps have an manifestURL as well as a name and check for that #31259

Closed
wants to merge 2 commits into from

Conversation

mermi
Copy link
Contributor

@mermi mermi commented Aug 5, 2015

No description provided.

@mozilla-autolander-deprecated
Copy link
Contributor

@@ -12,6 +12,7 @@
class Contacts(Base):

name = "Contacts"
origin_app_name = 'communications/contacts'
Copy link
Contributor

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'

@mwargers
Copy link
Contributor

mwargers commented Aug 5, 2015

edit: this was obsolete

@mozilla-autolander-deprecated
Copy link
Contributor

@mozilla-autolander-deprecated
Copy link
Contributor

@@ -10,6 +10,7 @@
class Search(Base):

name = 'Browser'
origin_app_name = 'search'
Copy link
Contributor

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.

@mozilla-autolander-deprecated
Copy link
Contributor

@mozilla-autolander-deprecated
Copy link
Contributor

@@ -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)
Copy link
Contributor

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)

@mozilla-autolander-deprecated
Copy link
Contributor

Wait(self.marionette).until(
lambda m: self.apps.displayed_app.name == 'Contacts')
lambda m: self.apps.displayed_app.region == Contacts.region)
Copy link
Contributor

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.

Copy link
Contributor Author

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

@mozilla-autolander-deprecated
Copy link
Contributor

@mozilla-autolander-deprecated
Copy link
Contributor

@mozilla-autolander-deprecated
Copy link
Contributor

@mozilla-autolander-deprecated
Copy link
Contributor

@mozilla-autolander-deprecated
Copy link
Contributor

@mozilla-autolander-deprecated
Copy link
Contributor

@mozilla-autolander-deprecated
Copy link
Contributor

@mozilla-autolander-deprecated
Copy link
Contributor

@mozilla-autolander-deprecated
Copy link
Contributor

@mozilla-autolander-deprecated
Copy link
Contributor

@mozilla-autolander-deprecated
Copy link
Contributor

@mozilla-autolander-deprecated
Copy link
Contributor

@mermi mermi changed the title Bug 1188926 - Make all the apps have an origin as well as a name and check for that Bug 1188926 - Make all the apps have an manifestURL as well as a name and check for that Aug 25, 2015
@@ -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');
Copy link
Contributor

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.

@mozilla-autolander-deprecated
Copy link
Contributor

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,
Copy link
Contributor

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)
Copy link
Contributor

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.

@mozilla-autolander-deprecated
Copy link
Contributor

@@ -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
Copy link
Contributor

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.

@mozilla-autolander-deprecated
Copy link
Contributor

@@ -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(
Copy link
Contributor

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()

@mozilla-autolander-deprecated
Copy link
Contributor

@mozilla-autolander-deprecated
Copy link
Contributor

@mozilla-autolander-deprecated
Copy link
Contributor

@@ -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
Copy link
Contributor

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()

Copy link
Contributor Author

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 ?

Copy link
Contributor

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.

@mozilla-autolander-deprecated
Copy link
Contributor

@mozilla-autolander-deprecated
Copy link
Contributor

@@ -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()
Copy link
Contributor

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).

Copy link
Contributor

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.

Copy link
Contributor

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?

Copy link
Contributor

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!

@mozilla-autolander-deprecated
Copy link
Contributor

@mozilla-autolander-deprecated
Copy link
Contributor

@mozilla-autolander-deprecated
Copy link
Contributor

@mozilla-autolander-deprecated
Copy link
Contributor

@mozilla-autolander-deprecated
Copy link
Contributor

@mozilla-autolander-deprecated
Copy link
Contributor

@mozilla-autolander-deprecated
Copy link
Contributor

@mermi mermi closed this Sep 8, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants