Skip to content
This repository has been archived by the owner on Aug 20, 2018. It is now read-only.

Commit

Permalink
Bug 858731 - Update mutt test constants to BASE_URL,TEST_DATA. r=hskupin
Browse files Browse the repository at this point in the history
  • Loading branch information
tojon authored and whimboo committed May 23, 2013
1 parent 46d3190 commit 668bf48
Show file tree
Hide file tree
Showing 27 changed files with 109 additions and 115 deletions.
6 changes: 3 additions & 3 deletions mutt/mutt/tests/js/controller/contextmenu.js
Expand Up @@ -2,8 +2,8 @@
* 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/. */

const TEST_FOLDER = collector.addHttpResource('../_files/');

const BASE_URL = collector.addHttpResource("../_files/");
const TEST_DATA = BASE_URL + "form.html";

var setupModule = function () {
controller = mozmill.getBrowserController();
Expand All @@ -13,7 +13,7 @@ var setupModule = function () {
}

var testMenu = function () {
controller.open(TEST_FOLDER + "form.html");
controller.open(TEST_DATA);
controller.waitForPageLoad();

// Enter text in a text field and select all via the context menu
Expand Down
4 changes: 3 additions & 1 deletion mutt/mutt/tests/js/controller/dnd_chrome.js
Expand Up @@ -2,12 +2,14 @@
* 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/. */

const TEST_DATA = "chrome://mozmill/content/test/test.xul";

var setupModule = function () {
controller = mozmill.getBrowserController();
}

var test = function () {
controller.open("chrome://mozmill/content/test/test.xul");
controller.open(TEST_DATA);
controller.waitForPageLoad();

let bar = new elementslib.ID(controller.window.document, "item1");
Expand Down
4 changes: 3 additions & 1 deletion mutt/mutt/tests/js/controller/dnd_content.js
Expand Up @@ -2,12 +2,14 @@
* 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/. */

const TEST_DATA = "chrome://mozmill/content/test/test.html";

var setupModule = function () {
controller = mozmill.getBrowserController();
}

var test = function () {
controller.open("chrome://mozmill/content/test/test.html");
controller.open(TEST_DATA);
controller.waitForPageLoad();

let bar = new elementslib.ID(controller.window.document, "item1");
Expand Down
6 changes: 3 additions & 3 deletions mutt/mutt/tests/js/controller/dnd_content_chrome.js
Expand Up @@ -2,8 +2,8 @@
* 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/. */

const TEST_FOLDER = collector.addHttpResource('../_files/');

const BASE_URL = collector.addHttpResource("../_files/");
const TEST_DATA = BASE_URL + "link.html";

var setupModule = function () {
controller = mozmill.getBrowserController();
Expand All @@ -12,7 +12,7 @@ var setupModule = function () {
}

var test = function () {
controller.open(TEST_FOLDER + "link.html");
controller.open(TEST_DATA);
controller.waitForPageLoad();

let link = new elementslib.ID(controller.tabs.activeTab, "link");
Expand Down
6 changes: 3 additions & 3 deletions mutt/mutt/tests/js/controller/expected_events.js
Expand Up @@ -2,15 +2,15 @@
* 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/. */

const TEST_FOLDER = collector.addHttpResource('../_files/');

const BASE_URL = collector.addHttpResource("../_files/");
const TEST_DATA = BASE_URL + "form.html";

var setupModule = function () {
controller = mozmill.getBrowserController();
}

var test = function () {
controller.open(TEST_FOLDER + "form.html");
controller.open(TEST_DATA);
controller.waitForPageLoad();

let fname = new elementslib.ID(controller.tabs.activeTab, "fname");
Expand Down
6 changes: 3 additions & 3 deletions mutt/mutt/tests/js/controller/native_events.js
Expand Up @@ -2,15 +2,15 @@
* 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/. */

const TEST_FOLDER = collector.addHttpResource('../_files/');

const BASE_URL = collector.addHttpResource("../_files/");
const TEST_DATA = BASE_URL + "link.html";

var setupModule = function () {
controller = mozmill.getBrowserController();
}

var test = function () {
controller.open(TEST_FOLDER + "link.html");
controller.open(TEST_DATA);
controller.waitForPageLoad();

let link = new elementslib.ID(controller.tabs.activeTab, "link");
Expand Down
6 changes: 3 additions & 3 deletions mutt/mutt/tests/js/controller/screenshot.js
Expand Up @@ -2,15 +2,15 @@
* 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/. */

const TEST_FOLDER = collector.addHttpResource('../_files/');

const BASE_URL = collector.addHttpResource("../_files/");
const TEST_DATA = BASE_URL + "complex.html";

var setupModule = function () {
controller = mozmill.getBrowserController();
}

var test = function () {
controller.open(TEST_FOLDER + "complex.html");
controller.open(TEST_DATA);
controller.waitForPageLoad();

let content = findElement.ID(controller.tabs.activeTab, "content");
Expand Down
6 changes: 3 additions & 3 deletions mutt/mutt/tests/js/controller/synthesize_events.js
Expand Up @@ -2,15 +2,15 @@
* 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/. */

const TEST_FOLDER = collector.addHttpResource('../_files/');

const BASE_URL = collector.addHttpResource("../_files/");
const TEST_DATA = BASE_URL + "form.html";

var setupModule = function () {
controller = mozmill.getBrowserController();
}

var test = function () {
controller.open(TEST_FOLDER + "form.html");
controller.open(TEST_DATA);
controller.waitForPageLoad();

var fname = new elementslib.ID(controller.tabs.activeTab, "fname");
Expand Down
8 changes: 4 additions & 4 deletions mutt/mutt/tests/js/elementslib/mozelement.js
Expand Up @@ -2,15 +2,15 @@
* 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/. */

const TEST_FOLDER = collector.addHttpResource('../_files/');
const TEST_PAGE = TEST_FOLDER + "form.html";
const BASE_URL = collector.addHttpResource("../_files/");
const TEST_DATA = BASE_URL + "form.html";

var setupModule = function () {
controller = mozmill.getBrowserController();
}

var test = function () {
controller.open(TEST_PAGE);
controller.open(TEST_DATA);
controller.waitForPageLoad();

let textbox = findElement.ID(controller.tabs.activeTab, "fname");
Expand All @@ -24,7 +24,7 @@ var test = function () {
let previousURL = urlbar.getNode().value;

urlbar.keypress("a", {accelKey: true});
urlbar.sendKeys(TEST_PAGE);
urlbar.sendKeys(TEST_DATA);
urlbar.keypress("VK_RETURN", {});
controller.waitForPageLoad();

Expand Down
5 changes: 3 additions & 2 deletions mutt/mutt/tests/js/elementslib/mozelement_window.js
Expand Up @@ -2,7 +2,8 @@
* 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/. */

const TEST_FOLDER = collector.addHttpResource('../_files/');
const BASE_URL = collector.addHttpResource("../_files/");
const TEST_DATA = BASE_URL + "form.html";

// Bug 677364:
// Fix controller keyboard methods to allow a null parameter for the target element
Expand All @@ -14,7 +15,7 @@ var setupModule = function () {
}

var testContent = function () {
controller.open(TEST_FOLDER + "form.html");
controller.open(TEST_DATA);
controller.waitForPageLoad();

let textbox = new elementslib.ID(controller.tabs.activeTab, "fname");
Expand Down
6 changes: 3 additions & 3 deletions mutt/mutt/tests/js/elementslib/radio_buttons.js
Expand Up @@ -2,16 +2,16 @@
* 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/. */

const TEST_FOLDER = collector.addHttpResource('../_files/');

const BASE_URL = collector.addHttpResource("../_files/");
const TEST_DATA = BASE_URL + "radio_button.html";

var setupModule = function () {
controller = mozmill.getBrowserController();
}

var test = function () {
// Test content
controller.open(TEST_FOLDER + "radio_button.html");
controller.open(TEST_DATA);
controller.waitForPageLoad();

let radio1 = findElement.ID(controller.tabs.activeTab, "radio1");
Expand Down
6 changes: 3 additions & 3 deletions mutt/mutt/tests/js/elementslib/selector.js
Expand Up @@ -2,15 +2,15 @@
* 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/. */

const TEST_FOLDER = collector.addHttpResource('../_files/');

const BASE_URL = collector.addHttpResource("../_files/");
const TEST_DATA = BASE_URL + "complex.html";

var setupModule = function () {
controller = mozmill.getBrowserController();
}

var test = function () {
controller.open(TEST_FOLDER + "complex.html");
controller.open(TEST_DATA);
controller.waitForPageLoad();

var id = new elementslib.ID(controller.tabs.activeTab, "page-title");
Expand Down
8 changes: 4 additions & 4 deletions mutt/mutt/tests/js/elementslib/stale_element.js
Expand Up @@ -2,15 +2,15 @@
* 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/. */

const TEST_FOLDER = collector.addHttpResource('../_files/');
const TEST_PAGE = TEST_FOLDER + "singlediv.html";
const BASE_URL = collector.addHttpResource("../_files/");
const TEST_DATA = BASE_URL + "singlediv.html";

var setupModule = function () {
controller = mozmill.getBrowserController();
}

var test = function () {
controller.open(TEST_PAGE);
controller.open(TEST_DATA);
controller.waitForPageLoad();

var id = new elementslib.ID(controller.tabs.activeTab, "test-div");
Expand All @@ -20,7 +20,7 @@ var test = function () {
assert.ok(id.getNode(), "Element via ID() has been found.");
assert.ok(elem.getNode(), "Element via Elem() has been found.");

controller.open(TEST_PAGE);
controller.open(TEST_DATA);
controller.waitForPageLoad();

assert.ok(id.getNode(), "Element via ID() can still be found after a page load.");
Expand Down
5 changes: 3 additions & 2 deletions mutt/mutt/tests/js/elementslib/utf-8.js
Expand Up @@ -2,7 +2,8 @@
* 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/. */

const TEST_FOLDER = collector.addHttpResource('../_files/');
const BASE_URL = collector.addHttpResource("../_files/");
const TEST_DATA = BASE_URL + "form.html";

const TEST_STRINGS = [
"tanowiących",
Expand All @@ -14,7 +15,7 @@ var setupModule = function () {
};

var test = function () {
controller.open(TEST_FOLDER + "form.html");
controller.open(TEST_DATA);
controller.waitForPageLoad();

var textbox = new elementslib.ID(controller.tabs.activeTab, "fname");
Expand Down
16 changes: 8 additions & 8 deletions mutt/mutt/tests/js/frame/httpd/testHTTPd1.js
Expand Up @@ -8,24 +8,24 @@
* successive tests will fail because of an inappropriate shutdown of the server
**/

var setupModule = function () {
baseURL = collector.addHttpResource('../../_files/');
testPages = [
baseURL + 'complex.html',
baseURL + 'singlediv.html'
];
const BASE_URL = collector.addHttpResource("../../_files/");
const TEST_DATA = [
BASE_URL + "complex.html",
BASE_URL + "singlediv.html"
];

var setupModule = function () {
controller = mozmill.getBrowserController();
}

var testOpenLocalPages = function () {
testPages.forEach(function (aPage) {
TEST_DATA.forEach(function (aPage) {
controller.open(aPage);
controller.waitForPageLoad();

controller.sleep(500);
});

controller.open(testPages[0]);
controller.open(TEST_DATA[0]);
controller.waitForPageLoad();
}
10 changes: 3 additions & 7 deletions mutt/mutt/tests/js/frame/httpd/testHTTPd2.js
Expand Up @@ -4,6 +4,8 @@

Cu.import("resource://gre/modules/Services.jsm");

const BASE_URL = collector.addHttpResource("../../_files/");
const TEST_DATA = BASE_URL + "link.html";

observer = {
observe: function (subject, topic, data) {
Expand All @@ -16,18 +18,12 @@ observer = {


var setupModule = function () {
baseURL = collector.addHttpResource('../../_files/');
testPages = [
baseURL + 'link.html'
];

controller = mozmill.getBrowserController();

Services.obs.addObserver(observer, "http-on-examine-response", false);
}

var testHttpFailure = function() {
controller.open(testPages[0]);
controller.open(TEST_DATA);
controller.waitForPageLoad();

controller.waitFor(function () {
Expand Down
6 changes: 3 additions & 3 deletions mutt/mutt/tests/js/frame/syntax_error.js
Expand Up @@ -2,15 +2,15 @@
* 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/. */

const TEST_FOLDER = collector.addHttpResource('../_files/');

const BASE_URL = collector.addHttpResource("../_files/");
const TEST_DATA = BASE_URL + "link.html";

var setupModule = function () {
controller = mozmill.getBrowserController();
}

var testErrorConsole = function () {
controller.open(TEST_FOLDER + "link.html");
controller.open(TEST_DATA);
controller.waitForPageLoad();

// syntax error
Expand Down
8 changes: 3 additions & 5 deletions mutt/mutt/tests/js/l10n/getEntity.js
Expand Up @@ -4,22 +4,20 @@

const { getEntity } = require("l10n");


const DTD_FILE = "chrome://branding/locale/brand.dtd";

const TEST_DATA = "chrome://branding/locale/brand.dtd";

var test = function () {
// Test a known entity
try {
let value = getEntity([DTD_FILE], "vendorShortName");
let value = getEntity([TEST_DATA], "vendorShortName");
expect.ok(value, "Localized content of a known entity has been retrieved");
} catch (e) {
expect.fail("Localized content of a known entity has not been retrieved");
}

// Test an invalid entity
try {
getEntity([DTD_FILE], "test_entity");
getEntity([TEST_DATA], "test_entity");
expect.fail("Localized content of an unknown entity has been retrieved");
} catch (e) {
expect.pass("Localized content of an unknown entity has not been retrieved");
Expand Down

0 comments on commit 668bf48

Please sign in to comment.