Bug 1377523 - Part 2: fix for browser_toolbox_*. r=pbro

fixed the tests in devtools/client/framework/test/ to not to use data:
URI.
This commit is contained in:
Yoshi Huang 2017-07-10 12:30:10 +08:00
Родитель 52592be689
Коммит e1bd58ddb6
7 изменённых файлов: 27 добавлений и 26 удалений

Просмотреть файл

@ -5,7 +5,10 @@ support-files =
browser_toolbox_options_disable_js.html browser_toolbox_options_disable_js.html
browser_toolbox_options_disable_js_iframe.html browser_toolbox_options_disable_js_iframe.html
browser_toolbox_options_disable_cache.sjs browser_toolbox_options_disable_cache.sjs
browser_toolbox_sidebar_existing_tabs.xul
browser_toolbox_sidebar_events.xul
browser_toolbox_sidebar_tool.xul browser_toolbox_sidebar_tool.xul
browser_toolbox_sidebar_toolURL.xul
browser_toolbox_window_title_changes_page.html browser_toolbox_window_title_changes_page.html
browser_toolbox_window_title_frame_select_page.html browser_toolbox_window_title_frame_select_page.html
code_binary_search.coffee code_binary_search.coffee

Просмотреть файл

@ -7,13 +7,6 @@ function test() {
const Cu = Components.utils; const Cu = Components.utils;
let {ToolSidebar} = require("devtools/client/framework/sidebar"); let {ToolSidebar} = require("devtools/client/framework/sidebar");
const toolURL = "data:text/xml;charset=utf8,<?xml version='1.0'?>" +
"<window xmlns='http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul'>" +
"<hbox flex='1'><description flex='1'>foo</description><splitter class='devtools-side-splitter'/>" +
"<tabbox flex='1' id='sidebar' class='devtools-sidebar-tabs'><tabs/><tabpanels flex='1'/></tabbox>" +
"</hbox>" +
"</window>";
const tab1URL = "data:text/html;charset=utf8,<title>1</title><p>1</p>"; const tab1URL = "data:text/html;charset=utf8,<title>1</title><p>1</p>";
const tab2URL = "data:text/html;charset=utf8,<title>2</title><p>2</p>"; const tab2URL = "data:text/html;charset=utf8,<title>2</title><p>2</p>";
const tab3URL = "data:text/html;charset=utf8,<title>3</title><p>3</p>"; const tab3URL = "data:text/html;charset=utf8,<title>3</title><p>3</p>";
@ -26,7 +19,7 @@ function test() {
let toolDefinition = { let toolDefinition = {
id: "fakeTool4242", id: "fakeTool4242",
visibilityswitch: "devtools.fakeTool4242.enabled", visibilityswitch: "devtools.fakeTool4242.enabled",
url: toolURL, url: CHROME_URL_ROOT + "browser_toolbox_sidebar_toolURL.xul",
label: "FAKE TOOL!!!", label: "FAKE TOOL!!!",
isTargetSupported: () => true, isTargetSupported: () => true,
build: function (iframeWindow, toolbox) { build: function (iframeWindow, toolbox) {

Просмотреть файл

@ -7,13 +7,6 @@ function test() {
const Cu = Components.utils; const Cu = Components.utils;
const { ToolSidebar } = require("devtools/client/framework/sidebar"); const { ToolSidebar } = require("devtools/client/framework/sidebar");
const toolURL = "data:text/xml;charset=utf8,<?xml version='1.0'?>" +
"<window xmlns='http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul'>" +
"<hbox flex='1'><description flex='1'>foo</description><splitter class='devtools-side-splitter'/>" +
"<tabbox flex='1' id='sidebar' class='devtools-sidebar-tabs'><tabs/><tabpanels flex='1'/></tabbox>" +
"</hbox>" +
"</window>";
const tab1URL = "data:text/html;charset=utf8,<title>1</title><p>1</p>"; const tab1URL = "data:text/html;charset=utf8,<title>1</title><p>1</p>";
let collectedEvents = []; let collectedEvents = [];
@ -21,7 +14,7 @@ function test() {
let toolDefinition = { let toolDefinition = {
id: "testTool1072208", id: "testTool1072208",
visibilityswitch: "devtools.testTool1072208.enabled", visibilityswitch: "devtools.testTool1072208.enabled",
url: toolURL, url: CHROME_URL_ROOT + "browser_toolbox_sidebar_events.xul",
label: "Test tool", label: "Test tool",
isTargetSupported: () => true, isTargetSupported: () => true,
build: function (iframeWindow, toolbox) { build: function (iframeWindow, toolbox) {

Просмотреть файл

@ -0,0 +1,6 @@
<?xml version='1.0'?>
<window xmlns='http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul'>
<hbox flex='1'><description flex='1'>foo</description><splitter class='devtools-side-splitter'/>
<tabbox flex='1' id='sidebar' class='devtools-sidebar-tabs'><tabs/><tabpanels flex='1'/></tabbox>
</hbox>
</window>

Просмотреть файл

@ -9,18 +9,9 @@
const {ToolSidebar} = require("devtools/client/framework/sidebar"); const {ToolSidebar} = require("devtools/client/framework/sidebar");
const testToolURL = "data:text/xml;charset=utf8,<?xml version='1.0'?>" +
"<window xmlns='http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul'>" +
"<hbox flex='1'><description flex='1'>test tool</description>" +
"<splitter class='devtools-side-splitter'/>" +
"<tabbox flex='1' id='sidebar' class='devtools-sidebar-tabs'>" +
"<tabs><tab id='tab1' label='tab 1'></tab><tab id='tab2' label='tab 2'></tab></tabs>" +
"<tabpanels flex='1'><tabpanel id='tabpanel1'>tab 1</tabpanel><tabpanel id='tabpanel2'>tab 2</tabpanel></tabpanels>" +
"</tabbox></hbox></window>";
const testToolDefinition = { const testToolDefinition = {
id: "testTool", id: "testTool",
url: testToolURL, url: CHROME_URL_ROOT + "browser_toolbox_sidebar_existing_tabs.xul",
label: "Test Tool", label: "Test Tool",
isTargetSupported: () => true, isTargetSupported: () => true,
build: (iframeWindow, toolbox) => { build: (iframeWindow, toolbox) => {

Просмотреть файл

@ -0,0 +1,8 @@
<?xml version='1.0'?>
<window xmlns='http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul'>
<hbox flex='1'><description flex='1'>test tool</description>
<splitter class='devtools-side-splitter'/>
<tabbox flex='1' id='sidebar' class='devtools-sidebar-tabs'>
<tabs><tab id='tab1' label='tab 1'></tab><tab id='tab2' label='tab 2'></tab></tabs>
<tabpanels flex='1'><tabpanel id='tabpanel1'>tab 1</tabpanel><tabpanel id='tabpanel2'>tab 2</tabpanel></tabpanels>
</tabbox></hbox></window>

Просмотреть файл

@ -0,0 +1,7 @@
<?xml version='1.0'?>
<window xmlns='http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul'>
<hbox flex='1'><description flex='1'>foo</description><splitter class='devtools-side-splitter'/>
<tabbox flex='1' id='sidebar' class='devtools-sidebar-tabs'><tabs/><tabpanels flex='1'/></tabbox>
</hbox>
</window>