summaryrefslogtreecommitdiff
path: root/toolkit/devtools/inspector/test
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2017-06-06 17:46:00 +0200
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2017-06-06 17:46:00 +0200
commitdf8745b7c811db50bdfee835c78cbf401d05a29a (patch)
treed15dc891a59e972de12422c9c7f8b51c144aefef /toolkit/devtools/inspector/test
parent87a391ebff531ce6c944e485f0834c02d3df2527 (diff)
downloadpalemoon-gre-df8745b7c811db50bdfee835c78cbf401d05a29a.tar.gz
DevTools - Inspector - throws an errors
Diffstat (limited to 'toolkit/devtools/inspector/test')
-rw-r--r--toolkit/devtools/inspector/test/browser.ini2
-rw-r--r--toolkit/devtools/inspector/test/browser_inspector_search-04.js49
-rw-r--r--toolkit/devtools/inspector/test/doc_inspector_search-svg.html13
3 files changed, 64 insertions, 0 deletions
diff --git a/toolkit/devtools/inspector/test/browser.ini b/toolkit/devtools/inspector/test/browser.ini
index 5d8400d79..70e6465af 100644
--- a/toolkit/devtools/inspector/test/browser.ini
+++ b/toolkit/devtools/inspector/test/browser.ini
@@ -19,6 +19,7 @@ support-files =
doc_inspector_remove-iframe-during-load.html
doc_inspector_search.html
doc_inspector_search-suggestions.html
+ doc_inspector_search-svg.html
doc_inspector_select-last-selected-01.html
doc_inspector_select-last-selected-02.html
head.js
@@ -74,6 +75,7 @@ skip-if = e10s # Test synthesize scrolling events in content. Also, see bug 1035
[browser_inspector_search-01.js]
[browser_inspector_search-02.js]
[browser_inspector_search-03.js]
+[browser_inspector_search-04.js]
[browser_inspector_select-docshell.js]
[browser_inspector_select-last-selected.js]
[browser_inspector_search-navigation.js]
diff --git a/toolkit/devtools/inspector/test/browser_inspector_search-04.js b/toolkit/devtools/inspector/test/browser_inspector_search-04.js
new file mode 100644
index 000000000..74653a6c1
--- /dev/null
+++ b/toolkit/devtools/inspector/test/browser_inspector_search-04.js
@@ -0,0 +1,49 @@
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
+
+// Test that searching for classes on SVG elements does work (see bug 1219920).
+
+const TEST_URL = TEST_URL_ROOT + "doc_inspector_search-svg.html";
+
+// An array of (key, suggestions) pairs where key is a key to press and
+// suggestions is an array of suggestions that should be shown in the popup.
+const TEST_DATA = [{
+ key: "c",
+ suggestions: ["circle", ".class1", ".class2"]
+}, {
+ key: "VK_BACK_SPACE",
+ suggestions: []
+}, {
+ key: ".",
+ suggestions: [".class1", ".class2"]
+}];
+
+add_task(function* () {
+ let {inspector} = yield openInspectorForURL(TEST_URL);
+ let {searchBox} = inspector;
+ let popup = inspector.searchSuggestions.searchPopup;
+
+ yield focusSearchBoxUsingShortcut(inspector.panelWin);
+
+ for (let {key, suggestions} of TEST_DATA) {
+ info("Pressing " + key + " to get " + suggestions);
+
+ let command = once(searchBox, "command");
+ EventUtils.synthesizeKey(key, {}, inspector.panelWin);
+ yield command;
+
+ info("Waiting for search query to complete and getting the suggestions");
+ yield inspector.searchSuggestions._lastQuery;
+ let actualSuggestions = popup.getItems().reverse();
+
+ is(popup.isOpen ? actualSuggestions.length : 0, suggestions.length,
+ "There are expected number of suggestions.");
+
+ for (let i = 0; i < suggestions.length; i++) {
+ is(actualSuggestions[i].label, suggestions[i],
+ "The suggestion at " + i + "th index is correct.");
+ }
+ }
+});
diff --git a/toolkit/devtools/inspector/test/doc_inspector_search-svg.html b/toolkit/devtools/inspector/test/doc_inspector_search-svg.html
new file mode 100644
index 000000000..71c8229ba
--- /dev/null
+++ b/toolkit/devtools/inspector/test/doc_inspector_search-svg.html
@@ -0,0 +1,13 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>Inspector SVG Search Box Test</title>
+</head>
+<body>
+ <div class="class1"></div>
+ <svg>
+ <circle cx="0" cy="0" r="50" class="class2" />
+ </svg>
+</body>
+</html>