Bug 1450538 - Browser test to ensure that the StatusPanel displays an IDN. r=Gijs draft
authorMasatoshi Kimura <VYV03354@nifty.ne.jp>
Sat, 14 Apr 2018 21:27:11 +0900
changeset 782373 381a9c092bdfc1209d0d075a327bdfb7a02295b3
parent 782161 963a823ca4164e0beec157838853ea541dfbdc4e
push id106520
push userVYV03354@nifty.ne.jp
push dateSun, 15 Apr 2018 12:29:53 +0000
reviewersGijs
bugs1450538
milestone61.0a1
Bug 1450538 - Browser test to ensure that the StatusPanel displays an IDN. r=Gijs MozReview-Commit-ID: 2DFZgqQTN7K
browser/base/content/test/statuspanel/browser.ini
browser/base/content/test/statuspanel/browser_show_statuspanel_idn.js
--- a/browser/base/content/test/statuspanel/browser.ini
+++ b/browser/base/content/test/statuspanel/browser.ini
@@ -1,5 +1,7 @@
 [DEFAULT]
 support-files =
   head.js
 
 [browser_show_statuspanel_twice.js]
+[browser_show_statuspanel_idn.js]
+skip-if = webrender && verify
new file mode 100644
--- /dev/null
+++ b/browser/base/content/test/statuspanel/browser_show_statuspanel_idn.js
@@ -0,0 +1,23 @@
+/* Any copyright is dedicated to the Public Domain.
+   http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const TEST_PAGE_URL = encodeURI(`data:text/html;charset=utf-8,<a id="foo" href="http://nic.xn--rhqv96g/">abc</a><span id="bar">def</span>`);
+const TEST_STATUS_TEXT = "nic.\u4E16\u754C";
+
+/**
+ * Test that if the StatusPanel displays an IDN
+ * (Bug 1450538).
+ */
+add_task(async function test_show_statuspanel_twice() {
+  let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, TEST_PAGE_URL);
+
+  let promise = promiseStatusPanelShown(window, TEST_STATUS_TEXT);
+  ContentTask.spawn(tab.linkedBrowser, null, async () => {
+    content.document.links[0].focus();
+  });
+  await promise;
+
+  await BrowserTestUtils.removeTab(tab);
+});