Skip to content
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.

Bug 1123401 - Implement handling of chrome windows #50

Merged
merged 1 commit into from Jan 29, 2015
Merged

Bug 1123401 - Implement handling of chrome windows #50

merged 1 commit into from Jan 29, 2015

Conversation

whimboo
Copy link
Contributor

@whimboo whimboo commented Jan 23, 2015

Just for a sneak peak. This PR is not ready yet and needs some more methods and cleanups. But if you have time lets give me feedback.


:returns: Platform name
"""
return self.marionette.session_capabilities['platformName'].lower()
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 the sort of thing that should go in FirefoxTestCase.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about this first too but abandoned this idea because it would not be available for sub modules in that package. Something I would like to have is that modules would be able to access API classes and properties like those. Therefor the puppeteer modules need to be refactored so it only holds API level stuff. I would like to do that later.

@whimboo
Copy link
Contributor Author

whimboo commented Jan 28, 2015

A commit for the review comments and fixes for functional tests have been pushed. The remaining todos will get their own commits.

# when the tabs module gets implemented
def find_by_url(win):
with win.marionette.using_context('content'):
return win.marionette.get_url() == url
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Who is win.marionette? This is confusing, there's is only one marionette.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The callbacks have a parameter, which is the actual BaseWindow instance to operate on. Keep in mind that switch_to() iterates over all the existent chrome windows. Once we have the tabs module it will most likely look like win.tabbar.location == url. But we might wanna find a better test here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just mean that there's only one marionette, and it only relates to one browser state at a point in time. So we're saying win.marionette, but it's calling the same method as if we'd said self.marionette, but it sort of implies that we meaningfully have a marionette per window.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see my example above how it will look like later. You won't see that we call something via marionette in the future here. This is just to ensure we keep the right context and do not switch between global and local scope. Exactly that would be confusing.

"top level browsing contexts, but ended with %s." %
(self._start_handle_count, win_count))
finally:
MarionetteTestCase.tearDown(self, *args, **kwargs)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I support this finally block.

@whimboo
Copy link
Contributor Author

whimboo commented Jan 29, 2015

@chmanchester I pushed a new commit with all the remaining fixes from your last review. Can you please have a look if that is fine? If yes, lets get it squashed and landed.

@whimboo whimboo self-assigned this Jan 29, 2015
@chmanchester
Copy link
Contributor

Go ahead and merge it. We can leave anything else to a follow up.

@whimboo whimboo merged commit b534fd1 into mozilla:master Jan 29, 2015
@whimboo whimboo deleted the windows branch January 30, 2015 08:38
@whimboo whimboo removed their assignment Aug 13, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants