Merge lp:~abreu-alexandre/webbrowser-app/add-ap-tests-for-navigation-and-popup into lp:webbrowser-app

Proposed by Alexandre Abreu
Status: Needs review
Proposed branch: lp:~abreu-alexandre/webbrowser-app/add-ap-tests-for-navigation-and-popup
Merge into: lp:webbrowser-app
Diff against target: 564 lines (+319/-12)
11 files modified
src/app/webcontainer/WebApp.qml (+2/-0)
src/app/webcontainer/WebViewImplOxide.qml (+35/-9)
src/app/webcontainer/WebViewImplWebkit.qml (+3/-0)
src/app/webcontainer/WebappContainerWebview.qml (+4/-1)
src/app/webcontainer/webapp-container.cpp (+24/-2)
src/app/webcontainer/webapp-container.h (+1/-0)
src/app/webcontainer/webapp-container.qml (+2/-0)
tests/autopilot/webapp_container/tests/__init__.py (+14/-0)
tests/autopilot/webapp_container/tests/fake_servers.py (+84/-0)
tests/autopilot/webapp_container/tests/test_navigation_filtering.py (+92/-0)
tests/autopilot/webapp_container/tests/test_navigation_popup.py (+58/-0)
To merge this branch: bzr merge lp:~abreu-alexandre/webbrowser-app/add-ap-tests-for-navigation-and-popup
Reviewer Review Type Date Requested Status
system-apps-ci-bot continuous-integration Needs Fixing
PS Jenkins bot continuous-integration Approve
Ubuntu Phablet Team Pending
Review via email: mp+217811@code.launchpad.net

Commit message

Add navigation requested & popup handling AP tests

Description of the change

Add navigation requested & popup handling AP tests

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:509
http://s-jenkins.ubuntu-ci:8080/job/webbrowser-app-ci/788/
Executed test runs:
    UNSTABLE: http://s-jenkins.ubuntu-ci:8080/job/generic-mediumtests-trusty/5159
    FAILURE: http://s-jenkins.ubuntu-ci:8080/job/generic-mediumtests-trusty-touch/4270/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/webbrowser-app-trusty-amd64-ci/290
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/webbrowser-app-trusty-armhf-ci/290
        deb: http://s-jenkins.ubuntu-ci:8080/job/webbrowser-app-trusty-armhf-ci/290/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/webbrowser-app-trusty-i386-ci/290
    UNSTABLE: http://s-jenkins.ubuntu-ci:8080/job/autopilot-testrunner-otto-trusty/4433
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/generic-mediumtests-builder-trusty-amd64/5364
        deb: http://s-jenkins.ubuntu-ci:8080/job/generic-mediumtests-builder-trusty-amd64/5364/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/generic-mediumtests-builder-trusty-armhf/4804
        deb: http://s-jenkins.ubuntu-ci:8080/job/generic-mediumtests-builder-trusty-armhf/4804/artifact/work/output/*zip*/output.zip
    FAILURE: http://s-jenkins.ubuntu-ci:8080/job/generic-mediumtests-runner-mako/6497/console
    FAILURE: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/6575/console

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/webbrowser-app-ci/788/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:509
http://jenkins.qa.ubuntu.com/job/webbrowser-app-ci/794/
Executed test runs:
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/5218/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/4297
    SUCCESS: http://jenkins.qa.ubuntu.com/job/webbrowser-app-trusty-amd64-ci/296
    SUCCESS: http://jenkins.qa.ubuntu.com/job/webbrowser-app-trusty-armhf-ci/296
        deb: http://jenkins.qa.ubuntu.com/job/webbrowser-app-trusty-armhf-ci/296/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/webbrowser-app-trusty-i386-ci/296
    FAILURE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/4485/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/5443
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/5443/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/4883
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/4883/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/6524
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/6722

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/webbrowser-app-ci/794/rebuild

review: Needs Fixing (continuous-integration)
509. By Olivier Tilloy

Work around a recent regression by forcing the OSK to show up when the address bar is being focused. Fixes: 1316057

510. By PS Jenkins bot

Releasing 0.23+14.10.20140505-0ubuntu1

511. By Michael Sheldon

Resolve image URLs beginning with a double slash correctly for context menu items Fixes: 1311626

512. By Adnane Belmadiaf

Enabled passwordEchoEnabled Fixes: 1314251

513. By Olivier Tilloy

Build the models in a separate static lib, and link the unit tests against it.
This speeds up build time by avoiding having to recompile the models’ source for each unit test.

514. By Olivier Tilloy

Handle javascript console messages.

515. By Olivier Tilloy

Escape literal dots in UA override matching regular expressions.

516. By Olivier Tilloy

Enable localStorage by default in the browser. Fixes: 1309673, 1310658

517. By Olivier Tilloy

Ensure that the URL actually changes so that the address bar is updated in case the user has entered a new address that redirects to where she previously was. Fixes: 1306615

518. By Olivier Tilloy

Update bzr ignore rules.

519. By Alberto Mardegan

Split UbuntuWebContext into two different components:
- UbuntuWebContext, which is a WebContext derivative with the UA overrides for Ubuntu
- UbuntuSharedWebContext, which is a singleton for UbuntuWebContext

520. By PS Jenkins bot

Releasing 0.23+14.10.20140505.1-0ubuntu1

521. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

522. By Olivier Tilloy

Enable cross compilation for an ARM target on an X86 host.

523. By Olivier Tilloy

Port autopilot tests to Python 3.

524. By PS Jenkins bot

Releasing 0.23+14.10.20140506-0ubuntu1

525. By Alexandre Abreu

Add capability for single webapps to have specific UA overrides for the website that they serve Fixes: 1245465

526. By PS Jenkins bot

Releasing 0.23+14.10.20140506.1-0ubuntu1

527. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

528. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

529. By Alexandre Abreu

Add --local-webapp-manifest webapp container cli option to simplify the command line in the case of a local manifest.json file definition. This is to become a bit more important now that the manifest support thing like ua overrides that would be beneficial to webapp on touch.

530. By PS Jenkins bot

Releasing 0.23+14.10.20140514.1-0ubuntu1

531. By Michael Sheldon

Add support for downloading images via download manager and content-hub on non-desktop platforms.

532. By Tim Peeters

Push the initial Page on the PageStack.

533. By PS Jenkins bot

Releasing 0.23+14.10.20140515.1-0ubuntu1

534. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

535. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

536. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

537. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

538. By Olivier Tilloy

Remove an extraneous whitespace in the default UA on mobile.

539. By PS Jenkins bot

Releasing 0.23+14.10.20140521-0ubuntu1

540. By Olivier Tilloy

Fix FTBFS with Qt 5.3. Fixes: 1321440

541. By PS Jenkins bot

Releasing 0.23+14.10.20140521.1-0ubuntu1

542. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

543. By Olivier Tilloy

Various optimizations to the activity view. Fixes: 1260980

544. By Olivier Tilloy

Do not override the default height of the TextField that serves as the address bar. Fixes: 1317866

545. By PS Jenkins bot

Releasing 0.23+14.10.20140522.1-0ubuntu1

546. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

547. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

548. By Olivier Tilloy

Ensure the current webview is hidden while the activity view is visible,
and work around a bug in oxide that prevented new empty tabs from rendering.

549. By PS Jenkins bot

Releasing 0.23+14.10.20140526-0ubuntu1

550. By Olivier Tilloy

Ensure the main page that contains the webviews fills the main view. Fixes: 1321462

551. By PS Jenkins bot

Releasing 0.23+14.10.20140526.1-0ubuntu1

552. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

553. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

554. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

555. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

Revision history for this message
Olivier Tilloy (osomon) wrote :

There’s a bunch of trivial conflicts when merging this branch into the latest trunk, can you please fix them?

Revision history for this message
Alexandre Abreu (abreu-alexandre) wrote :

done

Revision history for this message
Olivier Tilloy (osomon) wrote :

I have a bunch of comments, see inline.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:556
http://jenkins.qa.ubuntu.com/job/webbrowser-app-ci/846/
Executed test runs:
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/557/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic-touch/141/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/webbrowser-app-utopic-amd64-ci/45
    SUCCESS: http://jenkins.qa.ubuntu.com/job/webbrowser-app-utopic-armhf-ci/45
        deb: http://jenkins.qa.ubuntu.com/job/webbrowser-app-utopic-armhf-ci/45/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/webbrowser-app-utopic-i386-ci/45
    FAILURE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/498/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/696
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/696/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/1166
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/1166/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/6776/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/7981

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/webbrowser-app-ci/846/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:558
http://jenkins.qa.ubuntu.com/job/webbrowser-app-ci/849/
Executed test runs:
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/562/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic-touch/144/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/webbrowser-app-utopic-amd64-ci/48
    SUCCESS: http://jenkins.qa.ubuntu.com/job/webbrowser-app-utopic-armhf-ci/48
        deb: http://jenkins.qa.ubuntu.com/job/webbrowser-app-utopic-armhf-ci/48/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/webbrowser-app-utopic-i386-ci/48
    FAILURE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/502/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/701
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/701/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/1180
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/1180/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/6780/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/7993

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/webbrowser-app-ci/849/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Alexandre Abreu (abreu-alexandre) wrote :

updated

Revision history for this message
Olivier Tilloy (osomon) wrote :

5 more comments inline.

Revision history for this message
Alexandre Abreu (abreu-alexandre) wrote :

To comment on a few notes:

> The type of the parameter for all those three signals should be 'url', not 'string'.

As I said earlier: yes I agree, but I get dbus runtime error on the AP side while trying to marshal the 'url' qml type to the QUrl qt type (unknown to dbus), ...

> this looks unsafe and abuse-prone to me, can’t we devise a more secure way of enabling tests, that doesn’t involve opening a backdoor in the container?

It is tricky to do something clean w/ this. Either way the container needs to run with some context, I did a few updates that makes it a bit cleaner ...

Revision history for this message
Olivier Tilloy (osomon) wrote :

> > The type of the parameter for all those three signals should be 'url', not
> 'string'.
>
> As I said earlier: yes I agree, but I get dbus runtime error on the AP side
> while trying to marshal the 'url' qml type to the QUrl qt type (unknown to
> dbus), ...

Ok, that makes sense.

> > this looks unsafe and abuse-prone to me, can’t we devise a more secure way
> of enabling tests, that doesn’t involve opening a backdoor in the container?
>
> It is tricky to do something clean w/ this. Either way the container needs to
> run with some context, I did a few updates that makes it a bit cleaner ...

I like the environment variable approach better. Can we not get rid of the --do-not-filter-url-patterns command line switch and rely only on the presence of the env var? (btw I would also check the value of the env var, if it’s "0" or "false" it should be ignored)

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
556. By Alberto Mardegan

Add online account support in the webapp container.

A new "accountProvider" command line parameter has been added to allow one to specify an account provider for the specific webapp launch. When used, one can specify a given provider, e.g. "facebook", to pull existing accounts (if any) from the specified provider
from Online Accounts.

When the provider does not have any existing account, an option to delegate the creation of such an account to OA is provided. It is also possible to skip the step and go straight to the target url.

557. By PS Jenkins bot

Releasing 0.23+14.10.20140602-0ubuntu1

558. By Alberto Mardegan

Fix the cookies unit tests

Make sure that the dbPath always refers to a file, not a directory.
Make sure that even on fast machines (or machines with a low-accuracy timer) the record timestamps are unique.

559. By Olivier Tilloy

Add a UA override rule for m.youtube.com to allow playing videos. Fixes: 1228415

560. By Olivier Tilloy

Do not display an empty contextual menu. Fixes: 1326752

561. By Michael Sheldon

Filter file uploads based on mime-type information (where available)

562. By PS Jenkins bot

Releasing 0.23+14.10.20140605-0ubuntu1

563. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

564. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

565. By Olivier Tilloy

Move version 0.2 of the API to "Ubuntu.Web" namespace, rename "UbuntuWebView" to "WebView", and document the public API intended for application developers.

The legacy namespace and component name are kept around for compatibility with existing applications.

Version 0.1 of the API remains untouched (it is deprecated).

Packaging changes:
 - new qtdeclarative5-ubuntu-web-plugin package that contains the new namespace and name for the public QML API
 - updated runtime dependencies for webbrowser-app, webapp-container and qtdeclarative5-ubuntu-ui-extras-browser-plugin
 - updated descriptions for all packages
 - added missing multiarch stanza for webapp-container-autopilot
 - added missing predepends stanzas for multiarch packages Fixes: 1324180

566. By PS Jenkins bot

Releasing 0.23+14.10.20140609-0ubuntu1

Revision history for this message
Alexandre Abreu (abreu-alexandre) wrote :

updated

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
567. By Olivier Tilloy

Use encodeURIComponent() to encode search queries entered in the address bar. Fixes: 1314673

568. By PS Jenkins bot

Releasing 0.23+14.10.20140609.1-0ubuntu1

569. By David Barth

Accept navigation inside popups if the redirection stays within the set of accepted URLs. This helps support the account switching feature in Gmail for example.

An additional heuristics ensures that trampoline URLs don't leave a blank window in their originating webapp, as we navigate back to the page just before the trampoline. This avoids regressions in Facebook, Twitter and other apps using popup redirects to open external links. Fixes: 1324848

570. By PS Jenkins bot

Releasing 0.23+14.10.20140612.1-0ubuntu1

571. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

572. By Olivier Tilloy

debian/control: add fonts-liberation as a runtime dependency of webbrowser-app and webapp-container, for smoother rendering of webpages on devices. Fixes: 1322456

573. By Ugo Riboni

Update the application icon to the new suru theme.

This applies to desktop only. The current mobile theme (ubuntu-mobile-icons) still ships the old icon. Fixes: 1328147

574. By PS Jenkins bot

Releasing 0.23+14.10.20140617-0ubuntu1

575. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

576. By Olivier Tilloy

Honour fullscreen requests. Fixes: 1308947, 1328168

577. By PS Jenkins bot

Releasing 0.23+14.10.20140618.2-0ubuntu1

578. By PS Jenkins bot

No change rebuild against Qt 5.3

579. By PS Jenkins bot

Releasing 0.23+14.10.20140618.3-0ubuntu1

580. By Olivier Tilloy

Re-enable the geolocation permission request dialog, now that it is implemented in oxide.
Fix it in the webkit-based webapp container. Fixes: 1182658

581. By Olivier Tilloy

Temporarily work around bug #1328839 in qtubuntu by not toggling fullscreen on the window on devices.

Once the Qt compositor work lands (scheduled for mid July), the bug should be resolved and this workaround can be removed. Fixes: 1328839

582. By PS Jenkins bot

Releasing 0.23+14.10.20140620-0ubuntu1

583. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

584. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

585. By Michael Sheldon

Add support for sharing links via content-hub. Fixes: 1294764

586. By PS Jenkins bot

Releasing 0.23+14.10.20140627-0ubuntu1

587. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

588. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

589. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

590. By Olivier Tilloy

Re-enable contextual selection that had been disabled when switching to oxide.

Packaging change: renamed the qtdeclarative5-ubuntu-ui-extras-browser-plugin-assets package to qtdeclarative5-ubuntu-web-plugin-assets. Fixes: 1324292

591. By PS Jenkins bot

Releasing 0.23+14.10.20140630-0ubuntu1

592. By Olivier Tilloy

Add a user script that prevents so-called "smart banners" generated by the smartbanner jQuery plugin to show ads for native android/iOS apps. Fixes: 1329799

593. By Olivier Tilloy

Add support for custom search engines defined by the OpenSearch description document format
(http://www.opensearch.org/Specifications/OpenSearch/1.1). Fixes: 1277637, 1334546

594. By PS Jenkins bot

Releasing 0.23+14.10.20140630.1-0ubuntu1

595. By PS Jenkins bot

Resync trunk

596. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

597. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

598. By Alexandre Abreu

merge lp:~abreu-alexandre/webbrowser-app/add-ap-tests-for-navigation-and-popup

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
599. By Alexandre Abreu

fix

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alexandre Abreu (abreu-alexandre) wrote :

updated

Revision history for this message
Olivier Tilloy (osomon) wrote :

In a previous comment, I was suggesting to remove the "--block-open-external-urls" command-line switch, but I’m seeing what I assume is a leftover in src/app/webcontainer/webapp-container.cpp.

Revision history for this message
Olivier Tilloy (osomon) wrote :

$ pep8 tests
tests/autopilot/webapp_container/tests/__init__.py:56:80: E501 line too long (92 > 79 characters)
tests/autopilot/webapp_container/tests/__init__.py:75:80: E501 line too long (82 > 79 characters)

Can you please fix those two pep8 errors?

Revision history for this message
Alexandre Abreu (abreu-alexandre) wrote :

> In a previous comment, I was suggesting to remove the "--block-open-external-
> urls" command-line switch, but I’m seeing what I assume is a leftover in
> src/app/webcontainer/webapp-container.cpp.

I think your previous comment (that was addressed) was more about the "doFilterWebappUrlPatterns" flag which was now updated & cleaned w/ a env var approach,

I couldn't find references of a comment about the "--block" flag,

600. By Alexandre Abreu

pep8 fixes

Revision history for this message
Alexandre Abreu (abreu-alexandre) wrote :

> $ pep8 tests
> tests/autopilot/webapp_container/tests/__init__.py:56:80: E501 line too long
> (92 > 79 characters)
> tests/autopilot/webapp_container/tests/__init__.py:75:80: E501 line too long
> (82 > 79 characters)
>
>
> Can you please fix those two pep8 errors?

done

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Olivier Tilloy (osomon) wrote :

425 +from __future__ import absolute_import
522 +from __future__ import absolute_import

Those should probably be removed.

Revision history for this message
Olivier Tilloy (osomon) wrote :

445 + self.assertThat(lambda: webview.url,
446 + Eventually(Contains("/href-link")))

In case like this where comparing the value of a property on an object, the use of a lambda is superfluous, i.e. this will work:

    self.assertThat(webview.url, Eventually(Contains("/href-link")))

There are a number of places in the new tests that can be simplified.

Revision history for this message
Olivier Tilloy (osomon) wrote :

To get back (again, sorry…) on the WEBAPP_CONTAINER_AP_TESTS_NOT_FILTER_URL_PATTERNS environment variable mechanism, if I understand correctly you added this "backdoor" because UrlPatternUtils::transformWebappSearchPatternToSafePattern(…) doesn’t recognize patterns that contain a port number, right?

If this is correct, how hard (and desirable) would it be to update the method to recognize patterns that contain a port number? It sounds like this could be useful, as the port number is part of the URL specification, so there could be webapps with a well-known domain name that require it, e.g. https://mycoolwebapp.com:12345/.

Revision history for this message
Olivier Tilloy (osomon) wrote :

545 + self.assertThat(lambda: popup_watcher.was_emitted,
546 + Eventually(Equals(popup_should_be_opened)))

In the case where popup_should_be_opened is False (i.e. on devices), I don’t think this test is useful, because popup_watcher.was_emitted is initially False anyway, before it changes to True.
So you probably want to make this assertion conditional instead:

    if popup_should_be_opened:
        self.assertThat(popup_watcher.was_emitted, Eventually(Equals(True)))

Revision history for this message
Olivier Tilloy (osomon) wrote :

547 + self.assertThat(lambda: url_watcher.was_emitted,
548 + Eventually(Equals(False)))

The same remark applies to this kind of assertion: url_watcher.was_emitted is initially False, and the use of Eventually() doesn’t mean that autopilot will wait for some time before initially testing the assertion. So you might as well change it to:

    self.assertThat(url_watcher.was_emitted, Equals(False))

But this is racy at best. If you move it under the condition as suggested in the comment above, then it makes sense, because you check it after verifying that popup_watcher.was_emitted is True:

    if popup_should_be_opened:
        self.assertThat(popup_watcher.was_emitted, Eventually(Equals(True)))
        self.assertThat(url_watcher.was_emitted, Equals(False))

Revision history for this message
system-apps-ci-bot (system-apps-ci-bot) wrote :
review: Needs Fixing (continuous-integration)

Unmerged revisions

600. By Alexandre Abreu

pep8 fixes

599. By Alexandre Abreu

fix

598. By Alexandre Abreu

merge lp:~abreu-alexandre/webbrowser-app/add-ap-tests-for-navigation-and-popup

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/app/webcontainer/WebApp.qml'
2--- src/app/webcontainer/WebApp.qml 2014-06-09 19:47:56 +0000
3+++ src/app/webcontainer/WebApp.qml 2014-07-09 13:56:27 +0000
4@@ -38,6 +38,7 @@
5 property alias webappName: webview.webappName
6 property alias webappUrlPatterns: webview.webappUrlPatterns
7 property alias popupRedirectionUrlPrefix: webview.popupRedirectionUrlPrefix
8+ property alias blockOpenExternalUrls: webview.blockOpenExternalUrls
9
10 actions: [
11 Actions.Back {
12@@ -68,6 +69,7 @@
13
14 WebappContainerWebview {
15 id: webview
16+ objectName: "webview"
17 toolbar: panel.panel
18
19 anchors {
20
21=== modified file 'src/app/webcontainer/WebViewImplOxide.qml'
22--- src/app/webcontainer/WebViewImplOxide.qml 2014-07-08 08:22:55 +0000
23+++ src/app/webcontainer/WebViewImplOxide.qml 2014-07-09 13:56:27 +0000
24@@ -36,6 +36,16 @@
25 property var webappUrlPatterns: null
26 property string popupRedirectionUrlPrefix: ""
27
28+ // Mostly used for testing & avoid external urls to
29+ // "leak" in the default browser
30+ property bool blockOpenExternalUrls: false
31+
32+ // Those signals are used for testing purposes to externally
33+ // track down the various internal logic & steps of a popup lifecycle.
34+ signal openExternalUrlTriggered(string url)
35+ signal popupWindowOpened(string url)
36+ signal popupWindowClosed(string url)
37+
38 currentWebview: webview
39
40 contextualActions: ActionList {
41@@ -63,7 +73,7 @@
42 }
43
44 function haveValidUrlPatterns() {
45- return webappUrlPatterns && webappUrlPatterns.length !== 0
46+ return webview.webappUrlPatterns && webview.webappUrlPatterns.length !== 0
47 }
48
49 function isNewForegroundWebViewDisposition(disposition) {
50@@ -95,13 +105,16 @@
51 return false;
52 }
53
54+ function openUrlExternally(url) {
55+ webview.openExternalUrlTriggered(url)
56+ if ( ! webview.blockOpenExternalUrls)
57+ Qt.openUrlExternally(url)
58+ }
59+
60 function navigationRequestedDelegate(request) {
61 var newForegroundPageRequest = isNewForegroundWebViewDisposition(request.disposition)
62 var url = request.url.toString()
63
64- console.log("\nwebview: " + webview.toString())
65- console.log("navigationRequestedDelegate - " + url)
66-
67 // Covers some edge cases corresponding to the default window.open() behavior.
68 // When it is being called, the targetted URL will not load right away but
69 // will first round trip to an "about:blank".
70@@ -123,6 +136,11 @@
71 : url;
72
73 if (webview.shouldAllowNavigationTo(targetUrl)) {
74+ if (formFactor === "desktop") {
75+ request.action = Oxide.NavigationRequest.ActionAccept
76+ return
77+ }
78+
79 console.debug('Redirecting popup browsing ' + targetUrl + ' in the current container window.')
80 request.action = Oxide.NavigationRequest.ActionReject
81 webappContainerHelper.browseToUrlRequested(webview, url.slice(url.indexOf(popupRedirectionUrlPrefix)))
82@@ -132,7 +150,7 @@
83 if (shouldOpenPopupsInDefaultBrowser()) {
84 console.debug('Opening popup window ' + url + ' in the browser window.')
85 request.action = Oxide.NavigationRequest.ActionReject
86- Qt.openUrlExternally(url)
87+ openUrlExternally(url)
88 return;
89 }
90 return
91@@ -169,7 +187,7 @@
92
93 if (request.action === Oxide.NavigationRequest.ActionReject) {
94 console.debug('Opening: ' + url + ' in the browser window.')
95- Qt.openUrlExternally(url)
96+ openUrlExternally(url)
97 }
98 }
99
100@@ -193,7 +211,7 @@
101 if ( ! isNewForegroundWebViewDisposition(request.disposition) &&
102 ! webview.shouldAllowNavigationTo(url)) {
103 request.action = Oxide.NavigationRequest.ActionReject
104- Qt.openUrlExternally(url);
105+ openUrlExternally(url)
106 popup.close()
107 return;
108 }
109@@ -223,12 +241,20 @@
110 return;
111
112 if (_url != 'about:blank' && ! webview.shouldAllowNavigationTo(_url)) {
113- Qt.openUrlExternally(_url);
114+ openUrlExternally(url)
115 popup.close()
116 }
117 }
118 }
119- Component.onCompleted: popup.show()
120+
121+ onVisibleChanged: {
122+ if (popup.visible)
123+ popupWindowOpened(popupBrowser.url);
124+ else
125+ popupWindowClosed(popupBrowser.url);
126+ }
127+
128+ Component.onCompleted: show()
129 }
130 }
131
132
133=== modified file 'src/app/webcontainer/WebViewImplWebkit.qml'
134--- src/app/webcontainer/WebViewImplWebkit.qml 2014-06-18 05:55:37 +0000
135+++ src/app/webcontainer/WebViewImplWebkit.qml 2014-07-09 13:56:27 +0000
136@@ -41,6 +41,9 @@
137 return webview.localUserAgentOverride.length === 0 ? undefined : webview.localUserAgentOverride
138 }
139
140+ // Is a no-op for QtWebkit
141+ property bool blockOpenExternalUrls: false
142+
143 experimental.certificateVerificationDialog: CertificateVerificationDialog {}
144 experimental.authenticationDialog: AuthenticationDialog {}
145 experimental.proxyAuthenticationDialog: ProxyAuthenticationDialog {}
146
147=== modified file 'src/app/webcontainer/WebappContainerWebview.qml'
148--- src/app/webcontainer/WebappContainerWebview.qml 2014-06-09 19:47:56 +0000
149+++ src/app/webcontainer/WebappContainerWebview.qml 2014-07-09 13:56:27 +0000
150@@ -32,12 +32,14 @@
151 property string webappName: ""
152 property var currentWebview: webappContainerWebViewLoader.item
153 property var toolbar: null
154+ property bool blockOpenExternalUrls: false
155 property var webappUrlPatterns
156 property string localUserAgentOverride: ""
157 property string popupRedirectionUrlPrefix: ""
158
159 Loader {
160 id: webappContainerWebViewLoader
161+ objectName: "containerWebviewLoader"
162 anchors.fill: parent
163 }
164
165@@ -55,7 +57,8 @@
166 , webappName: containerWebview.webappName
167 , webappUrlPatterns: containerWebview.webappUrlPatterns
168 , developerExtrasEnabled: containerWebview.developerExtrasEnabled
169- , popupRedirectionUrlPrefix: containerWebview.popupRedirectionUrlPrefix})
170+ , popupRedirectionUrlPrefix: containerWebview.popupRedirectionUrlPrefix
171+ , blockOpenExternalUrls: containerWebview.blockOpenExternalUrls})
172 }
173 }
174
175
176=== modified file 'src/app/webcontainer/webapp-container.cpp'
177--- src/app/webcontainer/webapp-container.cpp 2014-07-02 14:42:06 +0000
178+++ src/app/webcontainer/webapp-container.cpp 2014-07-09 13:56:27 +0000
179@@ -88,7 +88,8 @@
180 m_backForwardButtonsVisible(false),
181 m_addressBarVisible(false),
182 m_localWebappManifest(false),
183- m_webappContainerHelper(new WebappContainerHelper())
184+ m_webappContainerHelper(new WebappContainerHelper()),
185+ m_blockOpenExternalUrls(false)
186 {
187 }
188
189@@ -118,6 +119,8 @@
190 qDebug() << "Using" << (m_withOxide ? "Oxide" : "QtWebkit") << "as the web engine backend";
191 m_window->setProperty("oxide", m_withOxide);
192
193+ m_window->setProperty("blockOpenExternalUrls", m_blockOpenExternalUrls);
194+
195 m_window->setProperty("webappUrlPatterns", m_webappUrlPatterns);
196 QQmlContext* context = m_engine->rootContext();
197 if (m_storeSessionCookies) {
198@@ -201,6 +204,20 @@
199
200 void WebappContainer::parseCommandLine()
201 {
202+ const QString AP_TESTS_NOT_FILTER_URL_PATTERNS_ENV_VAR =
203+ qgetenv("WEBAPP_CONTAINER_AP_TESTS_NOT_FILTER_URL_PATTERNS");
204+
205+ // Used internally for testing when the browsed urls
206+ // are not totally properly formed for strict url patterns
207+ // (localhost:port, <ip>:port, etc.)
208+ bool doFilterWebappUrlPatterns =
209+ (AP_TESTS_NOT_FILTER_URL_PATTERNS_ENV_VAR != "1");
210+
211+ if ( ! doFilterWebappUrlPatterns) {
212+ qWarning() << "NOT filtering webapp url patterns. "
213+ "Only use this for internal testing, not production.";
214+ }
215+
216 Q_FOREACH(const QString& argument, m_arguments) {
217 if (argument == "--webkit") {
218 // force webkit
219@@ -219,7 +236,10 @@
220 QString tail = argument.split("--webappUrlPatterns=")[1];
221 if (!tail.isEmpty()) {
222 QStringList includePatterns = tail.split(URL_PATTERN_SEPARATOR);
223- m_webappUrlPatterns = UrlPatternUtils::filterAndTransformUrlPatterns(includePatterns);
224+ m_webappUrlPatterns =
225+ doFilterWebappUrlPatterns ?
226+ UrlPatternUtils::filterAndTransformUrlPatterns(includePatterns)
227+ : includePatterns;
228 }
229 } else if (argument.startsWith("--accountProvider=")) {
230 m_accountProvider = argument.split("--accountProvider=")[1];
231@@ -233,6 +253,8 @@
232 m_localWebappManifest = true;
233 } else if (argument.startsWith("--popup-redirection-url-prefix=")) {
234 m_popupRedirectionUrlPrefix = argument.split("--popup-redirection-url-prefix=")[1];;
235+ } else if (argument == "--block-open-external-urls") {
236+ m_blockOpenExternalUrls = true;
237 }
238 }
239 }
240
241=== modified file 'src/app/webcontainer/webapp-container.h'
242--- src/app/webcontainer/webapp-container.h 2014-06-09 19:47:56 +0000
243+++ src/app/webcontainer/webapp-container.h 2014-07-09 13:56:27 +0000
244@@ -58,6 +58,7 @@
245 bool m_localWebappManifest;
246 QString m_popupRedirectionUrlPrefix;
247 QScopedPointer<WebappContainerHelper> m_webappContainerHelper;
248+ bool m_blockOpenExternalUrls;
249
250 static const QString URL_PATTERN_SEPARATOR;
251 };
252
253=== modified file 'src/app/webcontainer/webapp-container.qml'
254--- src/app/webcontainer/webapp-container.qml 2014-07-02 13:01:14 +0000
255+++ src/app/webcontainer/webapp-container.qml 2014-07-09 13:56:27 +0000
256@@ -39,6 +39,7 @@
257 property string accountProvider: ""
258 property string popupRedirectionUrlPrefix: ""
259 property var __webappCookieStore: null
260+ property bool blockOpenExternalUrls: false
261
262 contentOrientation: Screen.orientation
263
264@@ -75,6 +76,7 @@
265 webappModelSearchPath: root.webappModelSearchPath
266 webappName: root.webappName
267 webappUrlPatterns: root.webappUrlPatterns
268+ blockOpenExternalUrls: root.blockOpenExternalUrls
269
270 popupRedirectionUrlPrefix: root.popupRedirectionUrlPrefix
271
272
273=== modified file 'tests/autopilot/webapp_container/tests/__init__.py'
274--- tests/autopilot/webapp_container/tests/__init__.py 2014-05-02 05:44:36 +0000
275+++ tests/autopilot/webapp_container/tests/__init__.py 2014-07-09 13:56:27 +0000
276@@ -43,12 +43,18 @@
277 return LOCAL_BROWSER_CONTAINER_PATH_NAME
278 return INSTALLED_BROWSER_CONTAINER_PATH_NAME
279
280+ def setUp(self):
281+ self.pointing_device = toolkit_emulators.get_pointing_device()
282+ super(WebappContainerTestCaseBase, self).setUp()
283+
284 def launch_webcontainer_app(self, args):
285 if model() != 'Desktop':
286 args.append(
287 '--desktop_file_hint=/usr/share/applications/'
288 'webbrowser-app.desktop')
289 try:
290+ self.patch_environment(
291+ "WEBAPP_CONTAINER_AP_TESTS_NOT_FILTER_URL_PATTERNS", "1")
292 self.app = self.launch_test_application(
293 self.get_webcontainer_app_path(),
294 *args,
295@@ -62,6 +68,14 @@
296 def get_webcontainer_window(self):
297 return self.app.select_single(objectName="webappContainer")
298
299+ def get_webview(self):
300+ return self.app.select_single(objectName="webview")
301+
302+ def get_oxide_webview(self):
303+ container = self.get_webview().select_single(
304+ objectName='containerWebviewLoader')
305+ return container.select_single('WebViewImplOxide')
306+
307 def get_webcontainer_webview(self):
308 return self.app.select_single(objectName="webappBrowserView")
309
310
311=== modified file 'tests/autopilot/webapp_container/tests/fake_servers.py'
312--- tests/autopilot/webapp_container/tests/fake_servers.py 2014-04-24 10:50:42 +0000
313+++ tests/autopilot/webapp_container/tests/fake_servers.py 2014-07-09 13:56:27 +0000
314@@ -42,6 +42,90 @@
315 if self.path == '/':
316 self.send_response(200)
317 self.serve_content(self.basic_html_content())
318+ elif self.path == '/href-link':
319+ self.send_response(200)
320+ html_response = """
321+ <html>
322+ <head>
323+ <script>
324+ window.onload = function() {
325+ document.addEventListener('click', function() {
326+ document.querySelector('div a').click();
327+ });
328+ };
329+ </script>
330+ </head>
331+ <body>
332+ <div style="width: 100%; height: 100%">
333+ <h1><a href="target-blank">local href link</a></h1>
334+ </div>
335+ </body>
336+ </html>
337+ """
338+ self.serve_content(html_response)
339+ elif self.path == '/redirect':
340+ self.send_response(303)
341+ self.send_header("Location", "href-link")
342+ self.end_headers()
343+ elif self.path == '/window-open-to-redirect':
344+ self.send_response(200)
345+ html_response = """
346+ <html>
347+ <head>
348+ <script>
349+ window.onload = function() {
350+ document.addEventListener('click', function() {
351+ window.open("redirect");
352+ });
353+ };
354+ </script>
355+ </head>
356+ <body>
357+ <div style="width: 100%; height: 100%"></div>
358+ </body>
359+ </html>
360+ """
361+ self.serve_content(html_response)
362+ elif self.path == '/window-open':
363+ self.send_response(200)
364+ html_response = """
365+ <html>
366+ <head>
367+ <script>
368+ window.onload = function() {
369+ document.addEventListener('click', function() {
370+ window.open("window-open");
371+ });
372+ };
373+ </script>
374+ </head>
375+ <body>
376+ <div style="width: 100%; height: 100%"></div>
377+ </body>
378+ </html>
379+ """
380+ self.serve_content(html_response)
381+ elif self.path == '/target-blank':
382+ self.send_response(200)
383+ html_response = """
384+ <html>
385+ <head>
386+ <script>
387+ window.onload = function() {
388+ document.addEventListener('click', function() {
389+ document.querySelector('div a').click();
390+ });
391+ };
392+ </script>
393+ </head>
394+ <body>
395+ <div style="width: 100%; height: 100%">
396+ <h1><a href="target-blank" target="_blank">target-blank</a></h1>
397+ </div>
398+ </body>
399+ </html>
400+ """
401+ self.serve_content(html_response)
402 else:
403 self.send_error(404)
404
405
406=== added file 'tests/autopilot/webapp_container/tests/test_navigation_filtering.py'
407--- tests/autopilot/webapp_container/tests/test_navigation_filtering.py 1970-01-01 00:00:00 +0000
408+++ tests/autopilot/webapp_container/tests/test_navigation_filtering.py 2014-07-09 13:56:27 +0000
409@@ -0,0 +1,92 @@
410+# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
411+# Copyright 2014 Canonical
412+#
413+# This program is free software: you can redistribute it and/or modify it
414+# under the terms of the GNU General Public License version 3, as published
415+# by the Free Software Foundation.
416+#
417+# This program is distributed in the hope that it will be useful,
418+# but WITHOUT ANY WARRANTY; without even the implied warranty of
419+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
420+# GNU General Public License for more details.
421+#
422+# You should have received a copy of the GNU General Public License
423+# along with this program. If not, see <http://www.gnu.org/licenses/>.
424+
425+from __future__ import absolute_import
426+
427+from testtools import skipUnless
428+from testtools.matchers import Equals, Contains
429+from autopilot.matchers import Eventually
430+from autopilot import platform
431+
432+from webapp_container.tests import WebappContainerTestCaseWithLocalContentBase
433+
434+
435+class WebappContainerNavivationFilteringTestCase(
436+ WebappContainerTestCaseWithLocalContentBase):
437+
438+ def test_no_patterns(self):
439+ args = []
440+ self.launch_webcontainer_app_with_local_http_server(args, "/href-link")
441+
442+ webview = self.get_oxide_webview()
443+ url_watcher = webview.watch_signal('urlChanged()')
444+
445+ self.assertThat(lambda: webview.url,
446+ Eventually(Contains("/href-link")))
447+
448+ self.pointing_device.click_object(webview)
449+ self.assertThat(lambda: url_watcher.was_emitted,
450+ Eventually(Equals(True)))
451+ self.assertThat(lambda: webview.url,
452+ Eventually(Contains("/target-blank")))
453+
454+ def test_url_pattern_filtering(self):
455+ args = ['--webappUrlPatterns=' + self.base_url + '/href-link',
456+ '--block-open-external-urls']
457+ self.launch_webcontainer_app_with_local_http_server(args, "/href-link")
458+
459+ webview = self.get_oxide_webview()
460+ self.assertThat(lambda: webview.url,
461+ Eventually(Contains("/href-link")))
462+
463+ external_open_watcher = webview.watch_signal(
464+ 'openExternalUrlTriggered(QString)')
465+ url_watcher = webview.watch_signal('urlChanged()')
466+
467+ self.pointing_device.click_object(webview)
468+ self.assertThat(lambda: external_open_watcher.was_emitted,
469+ Eventually(Equals(True)))
470+ self.assertThat(url_watcher.was_emitted,
471+ Equals(False))
472+
473+ @skipUnless(platform.model() == 'Desktop', "Only runs on the Desktop")
474+ def test_url_pattern_filtering_in_popup(self):
475+ args = ['--webappUrlPatterns=' + self.base_url
476+ + '/window-open-to-redirect,' + self.base_url + '/redirect',
477+ '--block-open-external-urls']
478+ self.launch_webcontainer_app_with_local_http_server(
479+ args, "/window-open-to-redirect")
480+
481+ webview = self.get_oxide_webview()
482+ self.assertThat(lambda: webview.url,
483+ Eventually(Contains("/window-open-to-redirect")))
484+
485+ external_open_watcher = webview.watch_signal(
486+ 'openExternalUrlTriggered(QString)')
487+ url_watcher = webview.watch_signal('urlChanged()')
488+ popup_watcher = webview.watch_signal('popupWindowOpened(QString)')
489+ popup_closed_watcher = webview.watch_signal(
490+ 'popupWindowClosed(QString)')
491+
492+ self.pointing_device.click_object(webview)
493+
494+ self.assertThat(lambda: popup_watcher.was_emitted,
495+ Eventually(Equals(True)))
496+ self.assertThat(lambda: external_open_watcher.was_emitted,
497+ Eventually(Equals(True)))
498+ self.assertThat(lambda: popup_closed_watcher.was_emitted,
499+ Eventually(Equals(True)))
500+ self.assertThat(url_watcher.was_emitted,
501+ Equals(False))
502
503=== added file 'tests/autopilot/webapp_container/tests/test_navigation_popup.py'
504--- tests/autopilot/webapp_container/tests/test_navigation_popup.py 1970-01-01 00:00:00 +0000
505+++ tests/autopilot/webapp_container/tests/test_navigation_popup.py 2014-07-09 13:56:27 +0000
506@@ -0,0 +1,58 @@
507+# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
508+# Copyright 2014 Canonical
509+#
510+# This program is free software: you can redistribute it and/or modify it
511+# under the terms of the GNU General Public License version 3, as published
512+# by the Free Software Foundation.
513+#
514+# This program is distributed in the hope that it will be useful,
515+# but WITHOUT ANY WARRANTY; without even the implied warranty of
516+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
517+# GNU General Public License for more details.
518+#
519+# You should have received a copy of the GNU General Public License
520+# along with this program. If not, see <http://www.gnu.org/licenses/>.
521+
522+from __future__ import absolute_import
523+
524+from testtools.matchers import Equals
525+from autopilot.matchers import Eventually
526+from autopilot import platform
527+
528+from webapp_container.tests import WebappContainerTestCaseWithLocalContentBase
529+
530+
531+class WebappContainerNavivationRequestPolicyTestCase(
532+ WebappContainerTestCaseWithLocalContentBase):
533+
534+ def test_popup_window_open(self):
535+ args = ['--block-open-external-urls']
536+ popup_should_be_opened = platform.model() == "Desktop"
537+ self.launch_webcontainer_app_with_local_http_server(
538+ args, "/window-open")
539+
540+ webview = self.get_oxide_webview()
541+ popup_watcher = webview.watch_signal('popupWindowOpened(QString)')
542+ url_watcher = webview.watch_signal('urlChanged()')
543+
544+ self.pointing_device.click_object(webview)
545+ self.assertThat(lambda: popup_watcher.was_emitted,
546+ Eventually(Equals(popup_should_be_opened)))
547+ self.assertThat(lambda: url_watcher.was_emitted,
548+ Eventually(Equals(False)))
549+
550+ def test_popup_target_blank(self):
551+ args = ['--block-open-external-urls']
552+ popup_should_be_opened = platform.model() == "Desktop"
553+ self.launch_webcontainer_app_with_local_http_server(
554+ args, "/target-blank")
555+
556+ webview = self.get_oxide_webview()
557+ popup_watcher = webview.watch_signal('popupWindowOpened(QString)')
558+ url_watcher = webview.watch_signal('urlChanged()')
559+
560+ self.pointing_device.click_object(webview)
561+ self.assertThat(lambda: popup_watcher.was_emitted,
562+ Eventually(Equals(popup_should_be_opened)))
563+ self.assertThat(lambda: url_watcher.was_emitted,
564+ Eventually(Equals(False)))

Subscribers

People subscribed via source and target branches

to status/vote changes: