Bug 1260548: Follow-up: Add another missing dependency to mochitest.ini. r=me

MozReview-Commit-ID: 4kPs3voZsAm

--HG--
extra : rebase_source : f8494c3a1c255293b8c2fda963d622f864a32015
This commit is contained in:
Kris Maglione 2017-02-01 23:11:24 -08:00
Родитель a63d7359fa
Коммит a3b337643f
5 изменённых файлов: 18 добавлений и 16 удалений

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

@ -2,17 +2,16 @@
/* exported isPageActionShown clickPageAction, AppConstants */
const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
Cu.import("resource://gre/modules/PageActions.jsm");
var {AppConstants} = SpecialPowers.Cu.import("resource://gre/modules/AppConstants.jsm", {});
var {PageActions} = SpecialPowers.Cu.import("resource://gre/modules/PageActions.jsm", {});
{
let chromeScript = SpecialPowers.loadChromeScript(
SimpleTest.getTestFileURL("chrome_cleanup_script.js"));
SimpleTest.registerCleanupFunction(async () => {
await new Promise(resolve => setTimeout(resolve, 0));
chromeScript.sendAsyncMessage("check-cleanup");
let results = await chromeScript.promiseOneMessage("cleanup-results");

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

@ -9,6 +9,7 @@ support-files =
file_dummy.html
file_iframe_document.html
file_iframe_document.sjs
head.js
tags = webextensions
[test_ext_all_apis.html]

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

@ -13,6 +13,8 @@
<script type="text/javascript">
"use strict";
const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
Cu.import("resource://gre/modules/Services.jsm");
let dataURI = "iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAC4klEQVRYhdWXLWzbQBSADQtDAwsHC1tUhUxqfL67lk2tdn+OJg0ODU0rLByqgqINBY6tmlbn7LMTJ5FaFVVBk1G0oUGjG2jT2Y7jxmmcbU/6iJ+f36fz+e5sGP9riCGm9hB37RG+scd4Yo/wsDXCZyIE2xuXsce4bY+wXkAsQtzYmExrfFgvkJkRbkzo1ehoxx5iXcgI/9iYUGt8WH9MqDXEcmNChmEYrRCf2SHWeYgQx3x0tLNRIeKQLTtEFyJEep4NTuhk8BC+yMrwEE3+iozo42d8gK7FAOkMsRiiN8QhW2ttSK5QTfRRV4QoymVeJMvPvDp7gCZigD613MN6yRFA3SWarow9QB9LCfG+NeF9qCtjAKOSQjCqVKhfVsiHEQ+grgx/lRGqUihAc1uL8EFD+KCRO+GrF4J61phcoRoPoEzkYhZYpykh5sMb7kOdIeY+jHKur4QI4Feh4AFX1nVeLxrAvQchGsBz5ls6wa2QdwcvIcE2863bTH79KOvsz/uUYJsp+J0pSzNlDckVqqVGUAF+n6uS7txcOl6wot4JVy70ufDLy4pWLUQVPE81pRI0mGe9oxLMHSeohHvMs/STUNaUK6vDPCvOyxMFDx4achehRDJmHnydnkPww5OFfLxrGIZBFDyYl4LpMzlTQFIP6AQx86w2UeYBccFpJrcKv5L9eGDtUAU6RIELqsB74uynjy/UBRF1gS5BTFxwQT1wTiXoUg9MH7m/3NZRRoi5IJytUbMgzv4Wc832+oQkiKgEehmyMkkpKsFkQV11QsRJL5rJYBLItQgRaUZEmnoZXsomz3vGiWw+I9KMF9SVFOqZEemZekli1jN3U/UOqhHHvC6oWWGElhfSpGdOk6+O9prdwvtLj5BjRsQxdRnot+Zeifpy/2/0stktKTRNLmbk0mwXyl8253fyojj+8rxOHNAhjjm5n0/5OOCGOKBzkrMO0Z75lvSAzKlrF32Z/3z8BqLAn+yMV7VhAAAAAElFTkSuQmCC";

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

@ -14,8 +14,6 @@
"use strict";
add_task(function* () {
let win = window.open("http://example.org/");
let extension = ExtensionTestUtils.loadExtension({
manifest: {
"permissions": ["tabs"],
@ -134,8 +132,6 @@ add_task(function* () {
yield extension.startup();
yield extension.awaitFinish("tabs.create");
yield extension.unload();
win.close();
});
</script>

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

@ -33,6 +33,7 @@ add_task(function* test_onUpdated() {
];
let collectedSequence = [];
let tabId;
browser.tabs.onUpdated.addListener(function(tabId, updatedInfo) {
// onUpdated also fires with updatedInfo.faviconUrl, so explicitly
// check for updatedInfo.status before recording the event.
@ -41,7 +42,7 @@ add_task(function* test_onUpdated() {
}
});
browser.runtime.onMessage.addListener(msg => {
browser.runtime.onMessage.addListener(async msg => {
if (collectedSequence.length !== expectedSequence.length) {
browser.test.assertEq(
JSON.stringify(expectedSequence),
@ -65,10 +66,13 @@ add_task(function* test_onUpdated() {
}
}
await browser.tabs.remove(tabId);
browser.test.notifyPass("tabs.onUpdated");
});
browser.tabs.create({url: pageURL});
browser.tabs.create({url: pageURL}).then(tab => {
tabId = tab.id;
});
},
files: {
"content-script.js": `
@ -108,7 +112,7 @@ add_task(function* test_url() {
yield do_test_update(function background() {
// Create a new tab for testing update.
browser.tabs.create({}, function(tab) {
browser.tabs.onUpdated.addListener(function onUpdated(tabId, changeInfo) {
browser.tabs.onUpdated.addListener(async function onUpdated(tabId, changeInfo) {
// Check callback
browser.test.assertEq(tabId, tab.id, "Check tab id");
browser.test.log("onUpdate: " + JSON.stringify(changeInfo));
@ -117,7 +121,7 @@ add_task(function* test_url() {
"Check changeInfo.url");
browser.tabs.onUpdated.removeListener(onUpdated);
// Remove created tab.
browser.tabs.remove(tabId);
await browser.tabs.remove(tabId);
browser.test.notifyPass("finish");
}
});
@ -131,13 +135,13 @@ add_task(function* test_title() {
const url = "http://mochi.test:8888/tests/mobile/android/components/extensions/test/mochitest/context_tabs_onUpdated_page.html";
const tab = await browser.tabs.create({url});
browser.tabs.onUpdated.addListener(function onUpdated(tabId, changeInfo) {
browser.tabs.onUpdated.addListener(async function onUpdated(tabId, changeInfo) {
browser.test.assertEq(tabId, tab.id, "Check tab id");
browser.test.log(`onUpdated: ${JSON.stringify(changeInfo)}`);
if ("title" in changeInfo && changeInfo.title === "New Message (1)") {
browser.test.log("changeInfo.title is correct");
browser.tabs.onUpdated.removeListener(onUpdated);
browser.tabs.remove(tabId);
await browser.tabs.remove(tabId);
browser.test.notifyPass("finish");
}
});
@ -152,7 +156,7 @@ add_task(function* test_without_tabs_permission() {
const tab = await browser.tabs.create({url});
let count = 0;
browser.tabs.onUpdated.addListener(function onUpdated(tabId, changeInfo) {
browser.tabs.onUpdated.addListener(async function onUpdated(tabId, changeInfo) {
browser.test.assertEq(tabId, tab.id, "Check tab id");
browser.test.log(`onUpdated: ${JSON.stringify(changeInfo)}`);
@ -165,7 +169,7 @@ add_task(function* test_without_tabs_permission() {
if (count === 2) {
browser.test.log("Reload complete");
browser.tabs.onUpdated.removeListener(onUpdated);
browser.tabs.remove(tabId);
await browser.tabs.remove(tabId);
browser.test.notifyPass("finish");
}
}