[Pkg-mozext-commits] [requestpolicy] 213/280: unit test: check if scheme notification is shown

David Prévot taffit at moszumanska.debian.org
Sat May 2 20:30:29 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository requestpolicy.

commit 3beae5c89f4fd1493ef43206ae75aa5a5bd3d6bb
Author: Martin Kimmerle <dev at 256k.de>
Date:   Tue Feb 10 03:22:09 2015 +0100

    unit test: check if scheme notification is shown
    
    currently fails.
---
 tests/content/scheme-unknown-and-without-host.html | 13 ++++++
 tests/mozmill/tests/testPolicy/manifest.ini        |  1 +
 .../testPolicy/testSchemeWorkaround/manifest.ini   |  3 ++
 .../testSchemeWorkaround/testUnknownScheme.js      | 47 ++++++++++++++++++++++
 4 files changed, 64 insertions(+)

diff --git a/tests/content/scheme-unknown-and-without-host.html b/tests/content/scheme-unknown-and-without-host.html
new file mode 100644
index 0000000..9965642
--- /dev/null
+++ b/tests/content/scheme-unknown-and-without-host.html
@@ -0,0 +1,13 @@
+<!doctype html>
+<html>
+<head>
+  <meta charset="utf-8" />
+</head>
+<body>
+
+<p>
+  <a href="unknown-scheme:path-of-the-unknown-scheme">Click this link!</a>
+</p>
+
+</body>
+</html>
diff --git a/tests/mozmill/tests/testPolicy/manifest.ini b/tests/mozmill/tests/testPolicy/manifest.ini
index 9ebff53..0edd796 100644
--- a/tests/mozmill/tests/testPolicy/manifest.ini
+++ b/tests/mozmill/tests/testPolicy/manifest.ini
@@ -1,3 +1,4 @@
 [parent:../manifest.ini]
 
 [include:testIframeTree/manifest.ini]
+[include:testSchemeWorkaround/manifest.ini]
diff --git a/tests/mozmill/tests/testPolicy/testSchemeWorkaround/manifest.ini b/tests/mozmill/tests/testPolicy/testSchemeWorkaround/manifest.ini
new file mode 100644
index 0000000..5c9bfb9
--- /dev/null
+++ b/tests/mozmill/tests/testPolicy/testSchemeWorkaround/manifest.ini
@@ -0,0 +1,3 @@
+[parent:../manifest.ini]
+
+[testUnknownScheme.js]
diff --git a/tests/mozmill/tests/testPolicy/testSchemeWorkaround/testUnknownScheme.js b/tests/mozmill/tests/testPolicy/testSchemeWorkaround/testUnknownScheme.js
new file mode 100644
index 0000000..109a373
--- /dev/null
+++ b/tests/mozmill/tests/testPolicy/testSchemeWorkaround/testUnknownScheme.js
@@ -0,0 +1,47 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+/* global require, mozmill */
+/* exported setupModule, teardownModule, testUnknownScheme */
+
+var rpRootDir = "../../../";
+var rpConst = require(rpRootDir + "lib/constants");
+var rootDir = rpRootDir + rpConst.mozmillTestsRootDir;
+
+var tabs = require(rootDir + "firefox/lib/tabs");
+
+var rpUtils = require(rpRootDir + "lib/rp-utils");
+
+var TEST_URL = "http://www.maindomain.test/scheme-unknown-and-without-host.html";
+
+
+var setupModule = function(aModule) {
+  /* global controller, tabBrowser */
+  aModule.controller = mozmill.getBrowserController();
+  aModule.tabBrowser = new tabs.tabBrowser(aModule.controller);
+  aModule.tabBrowser.closeAllTabs();
+}
+
+var teardownModule = function(aModule) {
+  aModule.tabBrowser.closeAllTabs();
+}
+
+
+var testUnknownScheme = function() {
+  controller.open(TEST_URL);
+  controller.waitForPageLoad();
+
+  let link = rpUtils.getLink(controller);
+  link.click();
+
+  rpUtils.waitForTabLoad(controller, tabBrowser.getTab(0));
+
+  var getPanel = () => tabBrowser.getTabPanelElement(0,
+      '/{"value":"requestpolicy-scheme-notification"}');
+
+  controller.waitFor(() => getPanel().exists(),
+                     "The scheme notification has been displayed.");
+}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/requestpolicy.git



More information about the Pkg-mozext-commits mailing list