Bug 1062611 - Test for WebIDE tabs. r=paul

This commit is contained in:
J. Ryan Stinnett 2014-09-08 12:52:00 +02:00
parent e2529803f2
commit de792955d8
4 changed files with 31 additions and 7 deletions

View File

@ -2,8 +2,8 @@
subsuite = devtools
support-files =
addons/simulators.json
doc_tabs.html
head.js
templates.json
[browser_tabs.js]
skip-if = true # Fails on TBPL, to be fixed in bug 1062611

View File

@ -2,6 +2,8 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
const TEST_URI = "http://example.com/browser/browser/devtools/webide/test/doc_tabs.html";
function test() {
waitForExplicitFinish();
SimpleTest.requestCompleteLog();
@ -9,10 +11,14 @@ function test() {
Task.spawn(function() {
const { DebuggerServer } =
Cu.import("resource://gre/modules/devtools/dbg-server.jsm", {});
// Since we test the connections set below, destroy the server in case it
// was left open.
DebuggerServer.destroy();
DebuggerServer.init(function () { return true; });
DebuggerServer.addBrowserActors();
let tab = yield addTab("about:newtab");
let tab = yield addTab(TEST_URI);
let win = yield openWebIDE();
@ -23,15 +29,13 @@ function test() {
yield selectTabProject(win);
let project = win.AppManager.selectedProject;
is(project.location, "about:newtab", "Location is correct");
is(project.name, "New Tab", "Name is correct");
is(project.location, TEST_URI, "Location is correct");
is(project.name, "example.com: Test Tab", "Name is correct");
yield closeWebIDE(win);
DebuggerServer.destroy();
yield removeTab(tab);
finish();
});
}).then(finish, handleError);
}
function connectToLocal(win) {

View File

@ -0,0 +1,15 @@
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title>Test Tab</title>
</head>
<body>
Test Tab
</body>
</html>

View File

@ -153,3 +153,8 @@ function removeTab(aTab, aWindow) {
targetBrowser.removeTab(aTab);
return deferred.promise;
}
function handleError(aError) {
ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
finish();
}