This commit is contained in:
Ryan VanderMeulen 2014-12-10 15:51:58 -05:00
Родитель 34eb8302cf eacfd607a3
Коммит 77ed5bc87e
161 изменённых файлов: 1204 добавлений и 557 удалений

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

@ -21,5 +21,7 @@
%aboutHomeDTD;
<!ENTITY % searchBarDTD SYSTEM "chrome://browser/locale/searchbar.dtd">
%searchBarDTD;
<!ENTITY % syncBrandDTD SYSTEM "chrome://browser/locale/syncBrand.dtd">
%syncBrandDTD;
]>

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

@ -6,6 +6,9 @@ XPCOMUtils.defineLazyGetter(this, "FxAccountsCommon", function () {
return Cu.import("resource://gre/modules/FxAccountsCommon.js", {});
});
XPCOMUtils.defineLazyModuleGetter(this, "fxaMigrator",
"resource://services-sync/FxaMigrator.jsm");
const PREF_SYNC_START_DOORHANGER = "services.sync.ui.showSyncStartDoorhanger";
const DOORHANGER_ACTIVATE_DELAY_MS = 5000;
@ -29,6 +32,7 @@ let gFxAccounts = {
"weave:service:sync:start",
"weave:service:login:error",
"weave:service:setup-complete",
"fxa-migration:state-changed",
FxAccountsCommon.ONVERIFIED_NOTIFICATION,
FxAccountsCommon.ONLOGOUT_NOTIFICATION
];
@ -39,6 +43,13 @@ let gFxAccounts = {
return this.button = document.getElementById("PanelUI-fxa-status");
},
get strings() {
delete this.strings;
return this.strings = Services.strings.createBundle(
"chrome://browser/locale/accounts.properties"
);
},
get loginFailed() {
// Referencing Weave.Service will implicitly initialize sync, and we don't
// want to force that - so first check if it is ready.
@ -73,6 +84,10 @@ let gFxAccounts = {
gNavToolbox.addEventListener("customizationstarting", this);
gNavToolbox.addEventListener("customizationending", this);
// Request the current Legacy-Sync-to-FxA migration status. We'll be
// notified of fxa-migration:state-changed in response if necessary.
Services.obs.notifyObservers(null, "fxa-migration:state-request", null);
this._initialized = true;
this.updateUI();
@ -90,7 +105,7 @@ let gFxAccounts = {
this._initialized = false;
},
observe: function (subject, topic) {
observe: function (subject, topic, data) {
switch (topic) {
case FxAccountsCommon.ONVERIFIED_NOTIFICATION:
Services.prefs.setBoolPref(PREF_SYNC_START_DOORHANGER, true);
@ -98,6 +113,9 @@ let gFxAccounts = {
case "weave:service:sync:start":
this.onSyncStart();
break;
case "fxa-migration:state-changed":
this.onMigrationStateChanged(data, subject);
break;
default:
this.updateUI();
break;
@ -121,6 +139,14 @@ let gFxAccounts = {
}
},
onMigrationStateChanged: function (newState, email) {
this._migrationInfo = !newState ? null : {
state: newState,
email: email ? email.QueryInterface(Ci.nsISupportsString).data : null,
};
this.updateUI();
},
handleEvent: function (event) {
if (event.type == "activate") {
// Our window might have been in the background while we received the
@ -156,13 +182,24 @@ let gFxAccounts = {
},
updateUI: function () {
if (this._migrationInfo) {
this.showMigrationUI();
return;
}
// Bail out if FxA is disabled.
if (!this.weave.fxAccountsEnabled) {
// When migration transitions from needs-verification to the null state,
// fxAccountsEnabled is false because migration has not yet finished. In
// that case, hide the button. We'll get another notification with a null
// state once migration is complete.
this.button.hidden = true;
this.button.removeAttribute("fxastatus");
return;
}
// FxA is enabled, show the widget.
this.button.removeAttribute("hidden");
this.button.hidden = false;
// Make sure the button is disabled in customization mode.
if (this._inCustomizationMode) {
@ -180,15 +217,14 @@ let gFxAccounts = {
// Reset the button to its original state.
this.button.setAttribute("label", defaultLabel);
this.button.removeAttribute("tooltiptext");
this.button.removeAttribute("signedin");
this.button.removeAttribute("failed");
this.button.removeAttribute("fxastatus");
if (!this._inCustomizationMode) {
if (this.loginFailed) {
this.button.setAttribute("failed", "true");
this.button.setAttribute("fxastatus", "error");
this.button.setAttribute("label", errorLabel);
} else if (userData) {
this.button.setAttribute("signedin", "true");
this.button.setAttribute("fxastatus", "signedin");
this.button.setAttribute("label", userData.email);
this.button.setAttribute("tooltiptext", userData.email);
}
@ -205,15 +241,53 @@ let gFxAccounts = {
});
},
showMigrationUI: Task.async(function* () {
let status = null;
let label = null;
switch (this._migrationInfo.state) {
case fxaMigrator.STATE_USER_FXA:
status = "migrate-signup";
label = this.strings.formatStringFromName("needUser",
[this.button.getAttribute("fxabrandname")], 1);
break;
case fxaMigrator.STATE_USER_FXA_VERIFIED:
if (this._migrationInfo.email) {
status = "migrate-verify";
label = this.strings.formatStringFromName("needVerifiedUser",
[this._migrationInfo.email],
1);
}
break;
}
if (label && status) {
this.button.label = label;
this.button.hidden = false;
this.button.setAttribute("fxastatus", status);
} else {
Cu.reportError("Could not update menu panel button given migration " +
"state: " + this._migrationInfo.state);
}
}),
onMenuPanelCommand: function (event) {
let button = event.originalTarget;
if (button.hasAttribute("signedin")) {
switch (button.getAttribute("fxastatus")) {
case "signedin":
this.openPreferences();
} else if (button.hasAttribute("failed")) {
this.openSignInAgainPage();
} else {
this.openAccountsPage();
break;
case "error":
this.openSignInAgainPage("menupanel");
break;
case "migrate-signup":
fxaMigrator.createFxAccount(window);
break;
case "migrate-verify":
fxaMigrator.resendVerificationMail();
break;
default:
this.openAccountsPage(null, { entryPoint: "menupanel" });
break;
}
PanelUI.hide();
@ -223,23 +297,30 @@ let gFxAccounts = {
openPreferences("paneSync");
},
openAccountsPage: function () {
let entryPoint = "menupanel";
if (UITour.originTabs.get(window) && UITour.originTabs.get(window).has(gBrowser.selectedTab)) {
entryPoint = "uitour";
openAccountsPage: function (action, urlParams={}) {
// An entryPoint param is used for server-side metrics. If the current tab
// is UITour, assume that it initiated the call to this method and override
// the entryPoint accordingly.
if (UITour.originTabs.get(window) &&
UITour.originTabs.get(window).has(gBrowser.selectedTab)) {
urlParams.entryPoint = "uitour";
}
switchToTabHavingURI("about:accounts?entrypoint=" + entryPoint, true, {
let params = new URLSearchParams();
if (action) {
params.set("action", action);
}
for (let name in urlParams) {
if (urlParams[name] !== undefined) {
params.set(name, urlParams[name]);
}
}
let url = "about:accounts?" + params;
switchToTabHavingURI(url, true, {
replaceQueryString: true
});
},
openSignInAgainPage: function () {
let entryPoint = "menupanel";
if (UITour.originTabs.get(window) && UITour.originTabs.get(window).has(gBrowser.selectedTab)) {
entryPoint = "uitour";
}
switchToTabHavingURI("about:accounts?action=reauth&entrypoint=" + entryPoint, true, {
replaceQueryString: true
});
}
openSignInAgainPage: function (entryPoint) {
this.openAccountsPage("reauth", { entryPoint: entryPoint });
},
};

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

@ -92,6 +92,10 @@ let gSyncUI = {
// notificationbox will listen to observers from now on.
Services.obs.removeObserver(this, "weave:notification:added");
let idx = this._obs.indexOf("weave:notification:added");
if (idx >= 0) {
this._obs.splice(idx, 1);
}
},
_needsSetup: function SUI__needsSetup() {
@ -145,12 +149,13 @@ let gSyncUI = {
return;
let syncButton = document.getElementById("sync-button");
if (syncButton) {
syncButton.removeAttribute("status");
}
let panelHorizontalButton = document.getElementById("PanelUI-fxa-status");
[syncButton, panelHorizontalButton].forEach(function(button) {
if (!button)
return;
button.removeAttribute("status");
});
if (panelHorizontalButton) {
panelHorizontalButton.removeAttribute("syncstatus");
}
if (needsSetup && syncButton)
syncButton.removeAttribute("tooltiptext");
@ -164,12 +169,14 @@ let gSyncUI = {
if (!gBrowser)
return;
["sync-button", "PanelUI-fxa-status"].forEach(function(id) {
let button = document.getElementById(id);
if (!button)
return;
let button = document.getElementById("sync-button");
if (button) {
button.setAttribute("status", "active");
});
}
button = document.getElementById("PanelUI-fxa-status");
if (button) {
button.setAttribute("syncstatus", "active");
}
},
onLoginFinish: function SUI_onLoginFinish() {
@ -374,13 +381,7 @@ let gSyncUI = {
},
openSignInAgainPage: function (entryPoint = "syncbutton") {
// If the user is also in an uitour, set the entrypoint to `uitour`
if (UITour.originTabs.get(window) && UITour.originTabs.get(window).has(gBrowser.selectedTab)) {
entryPoint = "uitour";
}
switchToTabHavingURI("about:accounts?action=reauth&entrypoint=" + entryPoint, true, {
replaceQueryString: true
});
gFxAccounts.openSignInAgainPage(entryPoint);
},
// Helpers

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

@ -322,6 +322,7 @@ skip-if = e10s
[browser_findbarClose.js]
[browser_fullscreen-window-open.js]
skip-if = buildapp == 'mulet' || e10s || os == "linux" # Bug 933103 - mochitest's EventUtils.synthesizeMouse functions not e10s friendly. Linux: Intermittent failures - bug 941575.
[browser_fxa_migrate.js]
[browser_fxa_oauth.js]
[browser_gestureSupport.js]
skip-if = e10s # Bug 863514 - no gesture support.

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

@ -0,0 +1,64 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
const STATE_CHANGED_TOPIC = "fxa-migration:state-changed";
let imports = {};
Cu.import("resource://services-sync/FxaMigrator.jsm", imports);
add_task(function* test() {
// Fake the state where we need an FxA user.
let buttonPromise = promiseButtonMutation();
Services.obs.notifyObservers(null, "fxa-migration:state-changed",
fxaMigrator.STATE_USER_FXA);
let buttonState = yield buttonPromise;
assertButtonState(buttonState, "migrate-signup", true);
// Fake the state where we need a verified FxA user.
buttonPromise = promiseButtonMutation();
let email = Cc["@mozilla.org/supports-string;1"].
createInstance(Ci.nsISupportsString);
email.data = "foo@example.com";
Services.obs.notifyObservers(email, "fxa-migration:state-changed",
fxaMigrator.STATE_USER_FXA_VERIFIED);
buttonState = yield buttonPromise;
assertButtonState(buttonState, "migrate-verify", true,
"foo@example.com not verified");
// Fake the state where no migration is needed.
buttonPromise = promiseButtonMutation();
Services.obs.notifyObservers(null, "fxa-migration:state-changed", null);
buttonState = yield buttonPromise;
// In this case, the front end has called fxAccounts.getSignedInUser() to
// update the button label and status. But since there isn't actually a user,
// the button is left with no fxastatus.
assertButtonState(buttonState, "", true);
});
function assertButtonState(buttonState, expectedStatus, expectedVisible,
expectedLabel=undefined) {
Assert.equal(buttonState.fxastatus, expectedStatus,
"Button fxstatus attribute");
Assert.equal(!buttonState.hidden, expectedVisible, "Button visibility");
if (expectedLabel !== undefined) {
Assert.equal(buttonState.label, expectedLabel, "Button label");
}
}
function promiseButtonMutation() {
return new Promise((resolve, reject) => {
let obs = new MutationObserver(mutations => {
info("Observed mutations for attributes: " +
mutations.map(m => m.attributeName));
if (mutations.some(m => m.attributeName == "fxastatus")) {
obs.disconnect();
resolve({
fxastatus: gFxAccounts.button.getAttribute("fxastatus"),
hidden: gFxAccounts.button.hidden,
label: gFxAccounts.button.label,
});
}
});
obs.observe(gFxAccounts.button, { attributes: true });
});
}

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

@ -23,6 +23,7 @@
<toolbarbutton id="PanelUI-fxa-status"
defaultlabel="&fxaSignIn.label;"
errorlabel="&fxaSignInError.label;"
fxabrandname="&syncBrand.fxAccount.label;"
oncommand="gFxAccounts.onMenuPanelCommand(event);"
hidden="true"/>

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

@ -469,6 +469,13 @@ let LoopRoomsInternal = {
* @param {String} channelID Notification channel identifier.
*/
onNotification: function(version, channelID) {
// See if we received a notification for the channel that's currently active:
let channelIDs = MozLoopService.channelIDs;
if ((this.sessionType == LOOP_SESSION_TYPE.GUEST && channelID != channelIDs.roomsGuest) ||
(this.sessionType == LOOP_SESSION_TYPE.FXA && channelID != channelIDs.roomsFxA)) {
return;
}
gDirty = true;
this.getAll(version, () => {});
},

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

@ -23,14 +23,14 @@ loop.panel = (function(_, mozL10n) {
var TabView = React.createClass({displayName: 'TabView',
propTypes: {
buttonsHidden: React.PropTypes.bool,
buttonsHidden: React.PropTypes.array,
// The selectedTab prop is used by the UI showcase.
selectedTab: React.PropTypes.string
},
getDefaultProps: function() {
return {
buttonsHidden: false
buttonsHidden: []
};
},
@ -60,6 +60,9 @@ loop.panel = (function(_, mozL10n) {
return;
}
var tabName = tab.props.name;
if (this.props.buttonsHidden.indexOf(tabName) > -1) {
return;
}
var isSelected = (this.state.selectedTab == tabName);
if (!tab.props.hidden) {
tabButtons.push(
@ -77,9 +80,7 @@ loop.panel = (function(_, mozL10n) {
}, this);
return (
React.DOM.div({className: "tab-view-container"},
!this.props.buttonsHidden
? React.DOM.ul({className: "tab-view"}, tabButtons)
: null,
React.DOM.ul({className: "tab-view"}, tabButtons),
tabs
)
);
@ -782,6 +783,7 @@ loop.panel = (function(_, mozL10n) {
// Mostly used for UI components showcase and unit tests
callUrl: React.PropTypes.string,
userProfile: React.PropTypes.object,
// Used only for unit tests.
showTabButtons: React.PropTypes.bool,
selectedTab: React.PropTypes.string,
dispatcher: React.PropTypes.instanceOf(loop.Dispatcher).isRequired,
@ -929,12 +931,18 @@ loop.panel = (function(_, mozL10n) {
);
}
// Determine which buttons to NOT show.
var hideButtons = [];
if (!this.state.userProfile && !this.props.showTabButtons) {
hideButtons.push("contacts");
}
return (
React.DOM.div(null,
NotificationListView({notifications: this.props.notifications,
clearOnDocumentHidden: true}),
TabView({ref: "tabView", selectedTab: this.props.selectedTab,
buttonsHidden: !this.state.userProfile && !this.props.showTabButtons},
buttonsHidden: hideButtons},
this._renderRoomsOrCallTab(),
Tab({name: "contacts"},
ContactsList({selectTab: this.selectTab,

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

@ -23,14 +23,14 @@ loop.panel = (function(_, mozL10n) {
var TabView = React.createClass({
propTypes: {
buttonsHidden: React.PropTypes.bool,
buttonsHidden: React.PropTypes.array,
// The selectedTab prop is used by the UI showcase.
selectedTab: React.PropTypes.string
},
getDefaultProps: function() {
return {
buttonsHidden: false
buttonsHidden: []
};
},
@ -60,6 +60,9 @@ loop.panel = (function(_, mozL10n) {
return;
}
var tabName = tab.props.name;
if (this.props.buttonsHidden.indexOf(tabName) > -1) {
return;
}
var isSelected = (this.state.selectedTab == tabName);
if (!tab.props.hidden) {
tabButtons.push(
@ -77,9 +80,7 @@ loop.panel = (function(_, mozL10n) {
}, this);
return (
<div className="tab-view-container">
{!this.props.buttonsHidden
? <ul className="tab-view">{tabButtons}</ul>
: null}
<ul className="tab-view">{tabButtons}</ul>
{tabs}
</div>
);
@ -782,6 +783,7 @@ loop.panel = (function(_, mozL10n) {
// Mostly used for UI components showcase and unit tests
callUrl: React.PropTypes.string,
userProfile: React.PropTypes.object,
// Used only for unit tests.
showTabButtons: React.PropTypes.bool,
selectedTab: React.PropTypes.string,
dispatcher: React.PropTypes.instanceOf(loop.Dispatcher).isRequired,
@ -929,12 +931,18 @@ loop.panel = (function(_, mozL10n) {
);
}
// Determine which buttons to NOT show.
var hideButtons = [];
if (!this.state.userProfile && !this.props.showTabButtons) {
hideButtons.push("contacts");
}
return (
<div>
<NotificationListView notifications={this.props.notifications}
clearOnDocumentHidden={true} />
<TabView ref="tabView" selectedTab={this.props.selectedTab}
buttonsHidden={!this.state.userProfile && !this.props.showTabButtons}>
buttonsHidden={hideButtons}>
{this._renderRoomsOrCallTab()}
<Tab name="contacts">
<ContactsList selectTab={this.selectTab}

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

@ -193,6 +193,7 @@ body {
.room-list {
max-height: 335px; /* XXX better computation needed */
min-height: 7px;
overflow: auto;
border-top: 1px solid #ccc;
border-bottom: 1px solid #ccc;

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

@ -102,6 +102,9 @@ const kCreateRoomData = {
expiresAt: 1405534180
};
const kChannelGuest = MozLoopService.channelIDs.roomsGuest;
const kChannelFxA = MozLoopService.channelIDs.roomsFxA;
const normalizeRoom = function(room) {
delete room.currSize;
if (!("participants" in room)) {
@ -144,7 +147,7 @@ const onRoomDeleted = function(e, room) {
let idx = gExpectedDeletes.indexOf(room.roomToken);
Assert.ok(idx > -1, "Deleted room should be expected");
gExpectedDeletes.splice(idx, 1);
}
};
const onRoomJoined = function(e, room, participant) {
let participants = gExpectedJoins[room.roomToken];
@ -316,52 +319,73 @@ add_task(function* test_roomUpdates() {
"2a1787a6-4a73-43b5-ae3e-906ec1e763cb",
"781f012b-f1ea-4ce1-9105-7cfc36fb4ec7"
];
roomsPushNotification("1");
roomsPushNotification("1", kChannelGuest);
yield waitForCondition(() => Object.getOwnPropertyNames(gExpectedLeaves).length === 0);
gExpectedUpdates.push("_nxD4V4FflQ");
gExpectedJoins["_nxD4V4FflQ"] = ["2a1787a6-4a73-43b5-ae3e-906ec1e763cb"];
roomsPushNotification("2");
roomsPushNotification("2", kChannelGuest);
yield waitForCondition(() => Object.getOwnPropertyNames(gExpectedJoins).length === 0);
gExpectedUpdates.push("_nxD4V4FflQ");
gExpectedJoins["_nxD4V4FflQ"] = ["781f012b-f1ea-4ce1-9105-7cfc36fb4ec7"];
gExpectedLeaves["_nxD4V4FflQ"] = ["2a1787a6-4a73-43b5-ae3e-906ec1e763cb"];
roomsPushNotification("3");
roomsPushNotification("3", kChannelGuest);
yield waitForCondition(() => Object.getOwnPropertyNames(gExpectedLeaves).length === 0);
gExpectedUpdates.push("_nxD4V4FflQ");
gExpectedJoins["_nxD4V4FflQ"] = [
"2a1787a6-4a73-43b5-ae3e-906ec1e763cb",
"5de6281c-6568-455f-af08-c0b0a973100e"];
roomsPushNotification("4");
roomsPushNotification("4", kChannelGuest);
yield waitForCondition(() => Object.getOwnPropertyNames(gExpectedJoins).length === 0);
});
// Test if joining a room works as expected.
// Test if push updates' channelIDs are respected.
add_task(function* () {
function badRoomJoin() {
Assert.ok(false, "Unexpected 'joined' event emitted!");
}
LoopRooms.on("join", onRoomLeft);
roomsPushNotification("4", kChannelFxA);
LoopRooms.off("join", badRoomJoin);
// Set the userProfile to look like we're logged into FxA.
MozLoopServiceInternal.fxAOAuthTokenData = { token_type: "bearer" };
MozLoopServiceInternal.fxAOAuthProfile = { email: "fake@invalid.com" };
gExpectedUpdates.push("_nxD4V4FflQ");
gExpectedLeaves["_nxD4V4FflQ"] = [
"2a1787a6-4a73-43b5-ae3e-906ec1e763cb",
"5de6281c-6568-455f-af08-c0b0a973100e"
];
roomsPushNotification("3", kChannelFxA);
yield waitForCondition(() => Object.getOwnPropertyNames(gExpectedLeaves).length === 0);
});
// Test if joining a room as Guest works as expected.
add_task(function* test_joinRoomGuest() {
// We need these set up for getting the email address.
MozLoopServiceInternal.fxAOAuthTokenData = null;
MozLoopServiceInternal.fxAOAuthProfile = null;
let roomToken = "_nxD4V4FflQ";
let joinedData = yield LoopRooms.promise("join", roomToken);
Assert.equal(joinedData.action, "join");
});
// Test if joining a room as FxA user works as expected.
add_task(function* test_joinRoom() {
// We need these set up for getting the email address.
Services.prefs.setCharPref("loop.fxa_oauth.profile", JSON.stringify({
email: "fake@invalid.com"
}));
Services.prefs.setCharPref("loop.fxa_oauth.tokendata", JSON.stringify({
token_type: "bearer"
}));
MozLoopServiceInternal.fxAOAuthTokenData = { token_type: "bearer" };
MozLoopServiceInternal.fxAOAuthProfile = { email: "fake@invalid.com" };
let roomToken = "_nxD4V4FflQ";
let joinedData = yield LoopRooms.promise("join", roomToken);
Assert.equal(joinedData.action, "join");
Assert.equal(joinedData.displayName, "fake@invalid.com");
Services.prefs.clearUserPref("loop.fxa_oauth.profile");
Services.prefs.clearUserPref("loop.fxa_oauth.tokendata");
MozLoopServiceInternal.fxAOAuthTokenData = null;
MozLoopServiceInternal.fxAOAuthProfile = null;
});
// Test if refreshing a room works as expected.
@ -390,7 +414,7 @@ add_task(function* test_renameRoom() {
add_task(function* test_roomDeleteNotifications() {
gExpectedDeletes.push("_nxD4V4FflQ");
roomsPushNotification("5");
roomsPushNotification("5", kChannelGuest);
yield waitForCondition(() => gExpectedDeletes.length === 0);
});
@ -424,8 +448,8 @@ function run_test() {
// Revert original Chat.open implementation
Chat.open = openChatOrig;
Services.prefs.clearUserPref("loop.fxa_oauth.profile");
Services.prefs.clearUserPref("loop.fxa_oauth.tokendata");
MozLoopServiceInternal.fxAOAuthTokenData = null;
MozLoopServiceInternal.fxAOAuthProfile = null;
LoopRooms.off("add", onRoomAdded);
LoopRooms.off("update", onRoomUpdated);

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

@ -535,7 +535,7 @@
Section({name: "UnsupportedBrowserView"},
Example({summary: "Standalone Unsupported Browser"},
React.DOM.div({className: "standalone"},
UnsupportedBrowserView(null)
UnsupportedBrowserView({helper: {isFirefox: returnFalse}})
)
)
),

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

@ -535,7 +535,7 @@
<Section name="UnsupportedBrowserView">
<Example summary="Standalone Unsupported Browser">
<div className="standalone">
<UnsupportedBrowserView />
<UnsupportedBrowserView helper={{isFirefox: returnFalse}}/>
</div>
</Example>
</Section>

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

@ -171,7 +171,7 @@ SourcesView.prototype = Heritage.extend(WidgetMethods, {
let url = fullUrl.split(" -> ").pop();
let label = aSource.addonPath ? aSource.addonPath : SourceUtils.getSourceLabel(url);
if (aSource.introductionUrl) {
if (!aSource.url && aSource.introductionUrl) {
label += ' > eval';
}

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

@ -405,7 +405,9 @@ skip-if = e10s && debug
skip-if = e10s # Bug 1093535
[browser_dbg_sources-cache.js]
skip-if = e10s && debug
[browser_dbg_sources-eval.js]
[browser_dbg_sources-eval-01.js]
skip-if = e10s && debug
[browser_dbg_sources-eval-02.js]
skip-if = e10s && debug
[browser_dbg_sources-labels.js]
skip-if = e10s && debug

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

@ -27,7 +27,9 @@ function testPause() {
ok(gTarget.isThreadPaused,
"target.isThreadPaused has been updated to true.");
gToolbox.once("inspector-selected", testNotificationIsUp1);
gToolbox.once("inspector-selected").then(inspector => {
inspector.once("inspector-updated").then(testNotificationIsUp1);
});
gToolbox.selectTool("inspector");
});

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

@ -18,15 +18,8 @@ function test() {
gSources = gDebugger.DebuggerView.Sources;
gBreakpoints = gDebugger.DebuggerController.Breakpoints;
waitForSourceShown(gPanel, "-eval.js")
.then(run)
.then(null, aError => {
ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
});
});
function run() {
return Task.spawn(function*() {
yield waitForSourceShown(gPanel, "-eval.js");
is(gSources.values.length, 1, "Should have 1 source");
let newSource = waitForDebuggerEvents(gPanel, gDebugger.EVENTS.NEW_SOURCE);
@ -37,5 +30,5 @@ function test() {
yield closeDebuggerAndFinish(gPanel);
});
}
});
}

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

@ -0,0 +1,47 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Make sure eval scripts with the sourceURL pragma are correctly
* displayed
*/
const TAB_URL = EXAMPLE_URL + "doc_script-eval.html";
function test() {
let gTab, gPanel, gDebugger;
let gSources, gBreakpoints, gEditor;
initDebugger(TAB_URL).then(([aTab,, aPanel]) => {
gTab = aTab;
gPanel = aPanel;
gDebugger = gPanel.panelWin;
gSources = gDebugger.DebuggerView.Sources;
gBreakpoints = gDebugger.DebuggerController.Breakpoints;
gEditor = gDebugger.DebuggerView.editor;
return Task.spawn(function*() {
yield waitForSourceShown(gPanel, "-eval.js");
is(gSources.values.length, 1, "Should have 1 source");
let newSource = waitForDebuggerEvents(gPanel, gDebugger.EVENTS.NEW_SOURCE);
callInTab(gTab, "evalSourceWithSourceURL");
yield newSource;
is(gSources.values.length, 2, "Should have 2 sources");
let item = gSources.getItemForAttachment(e => e.label == "bar.js");
ok(item, "Source label is incorrect.");
ok(item.attachment.group === 'http://example.com', 'Source group is incorrect');
let shown = waitForDebuggerEvents(gPanel, gDebugger.EVENTS.SOURCE_SHOWN);
gSources.selectedItem = item;
yield shown;
ok(gEditor.getText().indexOf('bar = function() {') === 0,
'Correct source is shown');
yield closeDebuggerAndFinish(gPanel);
});
});
}

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

@ -4,3 +4,7 @@ var bar;
function evalSource() {
eval('bar = function() {\nvar x = 5;\n}');
}
function evalSourceWithSourceURL() {
eval('bar = function() {\nvar x = 6;\n} //# sourceURL=bar.js');
}

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

@ -13,5 +13,4 @@
<script type="text/javascript" src="code_script-eval.js"></script>
</body>
</html>

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

@ -418,9 +418,18 @@ InspectorPanel.prototype = {
if (reason !== "navigateaway" &&
this.canGetUniqueSelector &&
this.selection.isElementNode()) {
selection.getUniqueSelector().then((selector) => {
selection.getUniqueSelector().then(selector => {
this.selectionCssSelector = selector;
}).then(null, console.error);
}).then(null, e => {
// Only log this as an error if the panel hasn't been destroyed in the
// meantime.
if (!this._panelDestroyer) {
console.error(e);
} else {
console.warn("Could not set the unique selector for the newly "+
"selected node, the inspector was destroyed.");
}
});
}
let selfUpdate = this.updating("inspector-panel");

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

@ -30,6 +30,7 @@ support-files =
[browser_inspector_delete-selected-node-02.js]
[browser_inspector_delete-selected-node-03.js]
[browser_inspector_destroy-after-navigation.js]
[browser_inspector_destroy-before-ready.js]
[browser_inspector_gcli-inspect-command.js]
[browser_inspector_highlighter-01.js]
[browser_inspector_highlighter-02.js]

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

@ -0,0 +1,26 @@
/* 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 switching to the inspector panel and not waiting for it to be fully
// loaded doesn't fail the test with unhandled rejected promises.
add_task(function*() {
// At least one assertion is needed to avoid failing the test, but really,
// what we're interested in is just having the test pass when switching to the
// inspector.
ok(true);
yield addTab("data:text/html;charset=utf-8,test inspector destroy");
info("Open the toolbox on the debugger panel");
let target = TargetFactory.forTab(gBrowser.selectedTab);
let toolbox = yield gDevTools.showToolbox(target, "jsdebugger");
info("Switch to the inspector panel and immediately end the test");
let onInspectorSelected = toolbox.once("inspector-selected");
toolbox.selectTool("inspector");
let inspector = yield onInspectorSelected;
});

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

@ -80,7 +80,6 @@ function* testNavigate(inspector, ruleview) {
yield selectNode("#div-1", inspector);
yield togglePseudoClass(inspector);
yield inspector.once("computed-view-refreshed");
}
function* showPickerOn(selector, inspector) {

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

@ -232,10 +232,8 @@ let openLayoutView = Task.async(function*() {
*/
function waitForUpdate(inspector) {
let onLayoutView = inspector.once("layoutview-updated");
let onRuleView = inspector.once("rule-view-refreshed");
let onComputedView = inspector.once("computed-view-refreshed");
let onInspector = inspector.once("inspector-updated");
return promise.all([onLayoutView, onRuleView, onComputedView, onInspector]);
return promise.all([onLayoutView, onInspector]);
}
/**

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

@ -548,7 +548,9 @@ window.setPanel = function(panel) {
};
window.onunload = function() {
this.layoutview.destroy();
if (this.layoutview) {
this.layoutview.destroy();
}
if (elts) {
for (let i = 0; i < elts.length; i++) {
let elt = elts[i];

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

@ -747,6 +747,15 @@ MarkupView.prototype = {
}).then(() => {
// Why is this not working?
this.layoutHelpers.scrollIntoViewIfNeeded(this.getContainer(aNode).editor.elt, centered);
}, e => {
// Only report this rejection as an error if the panel hasn't been
// destroyed in the meantime.
if (!this._destroyer) {
console.error(e);
} else {
console.warn("Could not show the node, the markup-view was destroyed " +
"while waiting for children");
}
});
},

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

@ -588,7 +588,14 @@ CssHtmlTree.prototype = {
CssHtmlTree.propertyNames.push.apply(CssHtmlTree.propertyNames,
mozProps.sort());
this._createPropertyViews();
this._createPropertyViews().then(null, e => {
if (!this.styleInspector) {
console.warn("The creation of property views was cancelled because the " +
"computed-view was destroyed before it was done creating views");
} else {
console.error(e);
}
});
},
/**

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

@ -1460,10 +1460,12 @@ CssRuleView.prototype = {
this.menuitemSources.setAttribute("checked", isEnabled);
}
// update text of source links
for (let rule of this._elementStyle.rules) {
if (rule.editor) {
rule.editor.updateSourceLink();
// update text of source links if the rule-view is populated
if (this._elementStyle) {
for (let rule of this._elementStyle.rules) {
if (rule.editor) {
rule.editor.updateSourceLink();
}
}
}
},

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

@ -32,6 +32,7 @@ function RuleViewTool(inspector, window, iframe) {
this.clearUserProperties = this.clearUserProperties.bind(this);
this.onPropertyChanged = this.onPropertyChanged.bind(this);
this.onViewRefreshed = this.onViewRefreshed.bind(this);
this.onPanelSelected = this.onPanelSelected.bind(this);
this.view.element.addEventListener("CssRuleViewChanged", this.onPropertyChanged);
this.view.element.addEventListener("CssRuleViewRefreshed", this.onViewRefreshed);
@ -42,15 +43,24 @@ function RuleViewTool(inspector, window, iframe) {
this.inspector.on("layout-change", this.refresh);
this.inspector.selection.on("pseudoclass", this.refresh);
this.inspector.target.on("navigate", this.clearUserProperties);
this.inspector.sidebar.on("ruleview-selected", this.onPanelSelected);
this.onSelected();
}
RuleViewTool.prototype = {
isSidebarActive: function() {
return this.inspector.sidebar.getCurrentTabID() == "ruleview";
},
onSelected: function(event) {
// Ignore the event if the view has been destroyed
if (!this.view) {
// Ignore the event if the view has been destroyed, or if it's inactive.
// But only if the current selection isn't null. If it's been set to null,
// let the update go through as this is needed to empty the view on navigation.
let isDestroyed = !this.view;
let isInactive = !this.isSidebarActive() && this.inspector.selection.nodeFront;
if (isDestroyed || isInactive) {
return;
}
@ -69,7 +79,9 @@ RuleViewTool.prototype = {
},
refresh: function() {
this.view.refreshPanel();
if (this.isSidebarActive()) {
this.view.refreshPanel();
}
},
clearUserProperties: function() {
@ -78,6 +90,14 @@ RuleViewTool.prototype = {
}
},
onPanelSelected: function() {
if (this.inspector.selection.nodeFront === this.view.viewedElement) {
this.refresh();
} else {
this.onSelected();
}
},
onLinkClicked: function(event) {
let rule = event.detail.rule;
let sheet = rule.parentStyleSheet;
@ -121,6 +141,7 @@ RuleViewTool.prototype = {
this.inspector.selection.off("pseudoclass", this.refresh);
this.inspector.selection.off("new-node-front", this.onSelected);
this.inspector.target.off("navigate", this.clearUserProperties);
this.inspector.sidebar.off("ruleview-selected", this.onPanelSelected);
this.view.element.removeEventListener("CssRuleViewCSSLinkClicked", this.onLinkClicked);
this.view.element.removeEventListener("CssRuleViewChanged", this.onPropertyChanged);
@ -142,11 +163,13 @@ function ComputedViewTool(inspector, window, iframe) {
this.onSelected = this.onSelected.bind(this);
this.refresh = this.refresh.bind(this);
this.onPanelSelected = this.onPanelSelected.bind(this);
this.inspector.selection.on("detached", this.onSelected);
this.inspector.selection.on("new-node-front", this.onSelected);
this.inspector.on("layout-change", this.refresh);
this.inspector.selection.on("pseudoclass", this.refresh);
this.inspector.sidebar.on("computedview-selected", this.onPanelSelected);
this.view.selectElement(null);
@ -154,11 +177,20 @@ function ComputedViewTool(inspector, window, iframe) {
}
ComputedViewTool.prototype = {
isSidebarActive: function() {
return this.inspector.sidebar.getCurrentTabID() == "computedview";
},
onSelected: function(event) {
// Ignore the event if the view has been destroyed
if (!this.view) {
// Ignore the event if the view has been destroyed, or if it's inactive.
// But only if the current selection isn't null. If it's been set to null,
// let the update go through as this is needed to empty the view on navigation.
let isDestroyed = !this.view;
let isInactive = !this.isSidebarActive() && this.inspector.selection.nodeFront;
if (isDestroyed || isInactive) {
return;
}
this.view.setPageStyle(this.inspector.pageStyle);
if (!this.inspector.selection.isConnected() ||
@ -176,7 +208,17 @@ ComputedViewTool.prototype = {
},
refresh: function() {
this.view.refreshPanel();
if (this.isSidebarActive()) {
this.view.refreshPanel();
}
},
onPanelSelected: function() {
if (this.inspector.selection.nodeFront === this.view.viewedElement) {
this.refresh();
} else {
this.onSelected();
}
},
destroy: function() {
@ -184,6 +226,7 @@ ComputedViewTool.prototype = {
this.inspector.sidebar.off("computedview-selected", this.refresh);
this.inspector.selection.off("pseudoclass", this.refresh);
this.inspector.selection.off("new-node-front", this.onSelected);
this.inspector.sidebar.off("computedview-selected", this.onPanelSelected);
this.view.destroy();

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

@ -37,7 +37,6 @@ support-files =
[browser_computedview_original-source-link.js]
[browser_computedview_pseudo-element_01.js]
[browser_computedview_refresh-on-style-change_01.js]
[browser_computedview_refresh-on-style-change_02.js]
[browser_computedview_search-filter.js]
[browser_computedview_select-and-copy-styles.js]
[browser_computedview_style-editor-link.js]
@ -113,6 +112,7 @@ skip-if = e10s # bug 1040670 Cannot open inline styles in viewSourceUtils
[browser_styleinspector_context-menu-copy-color_02.js]
[browser_styleinspector_csslogic-content-stylesheets.js]
[browser_styleinspector_output-parser.js]
[browser_styleinspector_refresh_when_active.js]
[browser_styleinspector_tooltip-background-image.js]
[browser_styleinspector_tooltip-closes-on-new-selection.js]
[browser_styleinspector_tooltip-longhand-fontfamily.js]

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

@ -6,7 +6,7 @@
// Tests that the checkbox to include browser styles works properly.
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,default styles test");
info("Creating the test document");

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

@ -163,7 +163,7 @@ const TEST_DATA = [
}
];
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8," + PAGE_CONTENT);
let {inspector, view} = yield openComputedView();

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

@ -6,7 +6,7 @@
// Test computed view key bindings
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,default styles test");
info("Adding content to the test page");

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

@ -6,7 +6,7 @@
// Tests the computed-view keyboard navigation
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,computed view keyboard nav test");
content.document.body.innerHTML = '<style type="text/css"> ' +

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

@ -22,7 +22,7 @@ const TEST_URL = "data:text/html;charset=utf-8," + encodeURIComponent([
'</html>'
].join("\n"));
let test = asyncTest(function*() {
add_task(function*() {
yield addTab(TEST_URL);
let {toolbox, inspector, view} = yield openComputedView();

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

@ -9,7 +9,7 @@
const {PropertyView} = devtools.require("devtools/styleinspector/computed-view");
const TEST_URI = TEST_URL_ROOT + "doc_matched_selectors.html";
let test = asyncTest(function*() {
add_task(function*() {
yield addTab(TEST_URI);
let {toolbox, inspector, view} = yield openComputedView();

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

@ -6,7 +6,7 @@
// Tests for matched selector texts in the computed view
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,<div style='color:blue;'></div>");
info("Opening the computed view");

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

@ -12,7 +12,7 @@ const TEST_URI = TEST_URL_ROOT + "doc_media_queries.html";
let {PropertyView} = devtools.require("devtools/styleinspector/computed-view");
let {CssLogic} = devtools.require("devtools/styleinspector/css-logic");
let test = asyncTest(function*() {
add_task(function*() {
yield addTab(TEST_URI);
let {toolbox, inspector, view} = yield openComputedView();

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

@ -6,7 +6,7 @@
// Tests that the no results placeholder works properly.
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,no results placeholder test");
info("Creating the test document");

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

@ -12,7 +12,7 @@ const PREF = "devtools.styleeditor.source-maps-enabled";
const SCSS_LOC = "doc_sourcemaps.scss:4";
const CSS_LOC = "doc_sourcemaps.css:1";
let test = asyncTest(function*() {
add_task(function*() {
info("Turning the pref " + PREF + " on");
Services.prefs.setBoolPref(PREF, true);

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

@ -8,7 +8,7 @@
const TEST_URI = TEST_URL_ROOT + "doc_pseudoelement.html";
let test = asyncTest(function*() {
add_task(function*() {
yield addTab(TEST_URI);
let {toolbox, inspector, view} = yield openComputedView();

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

@ -10,7 +10,7 @@
const TESTCASE_URI = 'data:text/html;charset=utf-8,' +
'<div id="testdiv" style="font-size:10px;">Test div!</div>';
let test = asyncTest(function*() {
add_task(function*() {
yield addTab(TESTCASE_URI);
info("Opening the computed view and selecting the test node");

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

@ -1,37 +0,0 @@
/* 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 the computed view refreshes when the current node has its style
// changed, even if the view is not the active one
const TESTCASE_URI = 'data:text/html;charset=utf-8,' +
'<div id="testdiv" style="font-size:10px;">Test div!</div>';
let test = asyncTest(function*() {
yield addTab(TESTCASE_URI);
info("Opening the computed view and selecting the test node");
let {toolbox, inspector, view} = yield openComputedView();
yield selectNode("#testdiv", inspector);
let fontSize = getComputedViewPropertyValue(view, "font-size");
is(fontSize, "10px", "The computed view shows the right font-size");
info("Now switching to the rule view");
yield openRuleView();
info("Changing the node's style and waiting for the update");
let onUpdated = inspector.once("computed-view-refreshed");
getNode("#testdiv").style.cssText = "font-size: 20px; color: blue; text-align: center";
yield onUpdated;
fontSize = getComputedViewPropertyValue(view, "font-size");
is(fontSize, "20px", "The computed view shows the updated font-size");
let color = getComputedViewPropertyValue(view, "color");
is(color, "#00F", "The computed view also shows the color now");
let textAlign = getComputedViewPropertyValue(view, "text-align");
is(textAlign, "center", "The computed view also shows the text-align now");
});

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

@ -6,7 +6,7 @@
// Tests that the search filter works properly.
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,default styles test");
info("Creating the test document");

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

@ -10,7 +10,7 @@ XPCOMUtils.defineLazyGetter(this, "osString", function() {
return Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime).OS;
});
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,computed view copy test");
info("Creating the test document");

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

@ -50,7 +50,7 @@ const DOCUMENT_URL = "data:text/html;charset=utf-8,"+encodeURIComponent(
'</body>',
'</html>'].join("\n"));
let test = asyncTest(function*() {
add_task(function*() {
yield addTab(DOCUMENT_URL);
info("Opening the computed-view");

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

@ -9,7 +9,7 @@
const TEST_URI = TEST_URL_ROOT + "doc_content_stylesheet.html";
let test = asyncTest(function*() {
add_task(function*() {
yield addTab(TEST_URI);
let target = getNode("#target");

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

@ -19,7 +19,7 @@ let PAGE_CONTENT = [
'<div id="testid" class="testclass">Styled Node</div>'
].join("\n");
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,test rule view user changes");
info("Creating the test document");

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

@ -16,7 +16,7 @@ let PAGE_CONTENT = [
'<div id="testid">Styled Node</div>'
].join("\n");
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,test rule view user changes");
info("Creating the test document");

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

@ -6,7 +6,7 @@
// Test cancelling the addition of a new property in the rule-view
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,browser_ruleview_ui.js");
let {toolbox, inspector, view} = yield openRuleView();

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

@ -21,7 +21,7 @@ let PAGE_CONTENT = [
'<div id="testid" class="testclass">Styled Node</div>'
].join("\n");
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,test rule view user changes");
info("Creating the test document");

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

@ -7,7 +7,7 @@
// Test all sorts of additions and updates of properties in the rule-view
// FIXME: TO BE SPLIT IN *MANY* SMALLER TESTS
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,browser_ruleview_ui.js");
let {toolbox, inspector, view} = yield openRuleView();

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

@ -26,7 +26,7 @@ const TEST_DATA = [
{ node: "p", expected: "p" }
];
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,test rule view add rule");
info("Creating the test document");

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

@ -17,7 +17,7 @@ let PAGE_CONTENT = [
'<span>This is a span</span>'
].join("\n");
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,test rule view add rule");
info("Creating the test document");

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

@ -17,7 +17,7 @@ let PAGE_CONTENT = [
'<span>This is a span</span>'
].join("\n");
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,test rule view add rule");
info("Creating the test document");

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

@ -17,7 +17,7 @@ const PAGE_CONTENT = [
'Testing the color picker tooltip!'
].join("\n");
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,rule view color picker tooltip test");
content.document.body.innerHTML = PAGE_CONTENT;
let {toolbox, inspector, view} = yield openRuleView();

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

@ -19,7 +19,7 @@ const PAGE_CONTENT = [
'Testing the color picker tooltip!'
].join("\n");
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,rule view color picker tooltip test");
content.document.body.innerHTML = PAGE_CONTENT;
let {toolbox, inspector, view} = yield openRuleView();

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

@ -18,7 +18,7 @@ const PAGE_CONTENT = [
'Testing the color picker tooltip!'
].join("\n");
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,rule view color picker tooltip test");
content.document.body.innerHTML = PAGE_CONTENT;
let {toolbox, inspector, view} = yield openRuleView();

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

@ -15,7 +15,7 @@ const PAGE_CONTENT = [
'Testing the color picker tooltip!'
].join("\n");
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,rule view color picker tooltip test");
content.document.body.innerHTML = PAGE_CONTENT;
let {toolbox, inspector, view} = yield openRuleView();

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

@ -16,7 +16,7 @@ const PAGE_CONTENT = [
'Updating a gradient declaration with the color picker tooltip'
].join("\n");
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,rule view color picker tooltip test");
info("Creating the test document");

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

@ -18,7 +18,7 @@ const PAGE_CONTENT = [
'Testing the color picker tooltip!'
].join("\n");
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,rule view color picker tooltip test");
content.document.body.innerHTML = PAGE_CONTENT;
let {toolbox, inspector, view} = yield openRuleView();

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

@ -24,7 +24,7 @@ const PAGE_CONTENT = [
'<p>Testing the color picker tooltip!</p>'
].join("\n");
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,rule view color picker tooltip test");
content.document.body.innerHTML = PAGE_CONTENT;
let {toolbox, inspector, view} = yield openRuleView();

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

@ -15,7 +15,7 @@ const PAGE_CONTENT = [
'Testing the color picker tooltip!'
].join("\n");
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,rule view color picker tooltip test");
content.document.body.innerHTML = PAGE_CONTENT;
let {toolbox, inspector, view} = yield openRuleView();

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

@ -37,7 +37,7 @@ const TESTS = [
{selector: "*", propertyName: "box-shadow", nb: 2},
];
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,rule view color picker tooltip test");
content.document.body.innerHTML = PAGE_CONTENT;
let {toolbox, inspector, view} = yield openRuleView();

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

@ -55,7 +55,7 @@ let testData = [
let TEST_URL = "data:text/html;charset=utf-8,<h1 style='border: 1px solid red'>Filename" +
": browser_bug893965_css_property_completion_existing_property.js</h1>";
let test = asyncTest(function*() {
add_task(function*() {
yield addTab(TEST_URL);
let {toolbox, inspector, view} = yield openRuleView();

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

@ -39,7 +39,7 @@ let testData = [
let TEST_URL = "data:text/html;charset=utf-8,<h1 style='color: red'>Filename: " +
"browser_bug894376_css_value_completion_existing_property_value_pair.js</h1>";
let test = asyncTest(function*() {
add_task(function*() {
yield addTab(TEST_URL);
let {toolbox, inspector, view} = yield openRuleView();

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

@ -40,7 +40,7 @@ let testData = [
let TEST_URL = "data:text/html;charset=utf-8,<h1 style='border: 1px solid red'>Filename:" +
"browser_bug893965_css_property_completion_new_property.js</h1>";
let test = asyncTest(function*() {
add_task(function*() {
yield addTab(TEST_URL);
let {toolbox, inspector, view} = yield openRuleView();

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

@ -42,7 +42,7 @@ let testData = [
let TEST_URL = "data:text/html;charset=utf-8,<style>h1{border: 1px solid red}</style>" +
"<h1>Test element</h1>";
let test = asyncTest(function*() {
add_task(function*() {
yield addTab(TEST_URL);
let {toolbox, inspector, view} = yield openRuleView();

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

@ -6,7 +6,7 @@
// Test that the rule-view content is correct
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,browser_ruleview_content.js");
let {toolbox, inspector, view} = yield openRuleView();

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

@ -18,7 +18,7 @@ const CONTENT = '<body style="color:red;">\
const STRINGS = Services.strings
.createBundle("chrome://global/locale/devtools/styleinspector.properties");
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8," + CONTENT);
info("Getting the test element");

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

@ -20,7 +20,7 @@ const PAGE_CONTENT = [
'<div class="test">Testing the cubic-bezier tooltip!</div>'
].join("\n");
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,rule view cubic-bezier tooltip test");
content.document.body.innerHTML = PAGE_CONTENT;
let {toolbox, inspector, view} = yield openRuleView();

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

@ -15,7 +15,7 @@ const PAGE_CONTENT = [
'</style>'
].join("\n");
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,rule view cubic-bezier tooltip test");
content.document.body.innerHTML = PAGE_CONTENT;
let {toolbox, inspector, view} = yield openRuleView();

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

@ -15,7 +15,7 @@ const PAGE_CONTENT = [
'</style>',
].join("\n");
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,rule view cubic-bezier tooltip test");
content.document.body.innerHTML = PAGE_CONTENT;
let {toolbox, inspector, view} = yield openRuleView();

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

@ -23,7 +23,7 @@ const testData = [
{value: "blue", commitKey: "VK_TAB", modifiers: {shiftKey: true}, expected: "blue"}
];
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,test escaping property change reverts back to original value");
info("Creating the test document");

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

@ -7,7 +7,7 @@
// Test that increasing/decreasing values in rule view using
// arrow keys works correctly.
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,sample document for bug 722691");
createDocument();
let {toolbox, inspector, view} = yield openRuleView();

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

@ -6,7 +6,7 @@
// Checking properties orders and overrides in the rule-view
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,browser_ruleview_manipulation.js");
let {toolbox, inspector, view} = yield openRuleView();

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

@ -21,7 +21,7 @@ let PAGE_CONTENT = [
'<div id="testid" class="testclass">Styled Node</div>'
].join("\n");
let test = asyncTest(function*() {
add_task(function*() {
let tab = yield addTab("data:text/html;charset=utf-8,test rule view user changes");
info("Creating the test document");

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

@ -6,7 +6,7 @@
// Test several types of rule-view property edition
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,browser_ruleview_ui.js");
let {toolbox, inspector, view} = yield openRuleView();

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

@ -47,7 +47,7 @@ const TEST_DATA = [
}
];
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,test escaping selector change reverts back to original value");
info("Creating the test document");

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

@ -16,7 +16,7 @@ let PAGE_CONTENT = [
'<span id="testid2">This is a span</span>'
].join("\n");
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,test rule view selector changes");
info("Creating the test document");

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

@ -22,7 +22,7 @@ let PAGE_CONTENT = [
'<div id="testid3">B</div>'
].join("\n");
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,test rule view selector changes");
info("Creating the test document");

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

@ -33,7 +33,7 @@ const EXPECTED_COLOR = "rgb(255, 255, 85)"; // #ff5
// Test opening the eyedropper from the color picker. Pressing escape
// to close it, and clicking the page to select a color.
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,rule view eyedropper test");
content.document.body.innerHTML = PAGE_CONTENT;

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

@ -8,7 +8,7 @@
let {ELEMENT_STYLE} = devtools.require("devtools/server/actors/styles");
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,browser_inspector_changes.js");
let {toolbox, inspector, view} = yield openRuleView();

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

@ -7,7 +7,7 @@
// Test that focus doesn't leave the style editor when adding a property
// (bug 719916)
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,<h1>Some header text</h1>");
let {toolbox, inspector, view} = yield openRuleView();

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

@ -8,7 +8,7 @@
const TEST_URI = TEST_URL_ROOT + "doc_keyframeanimation.html";
let test = asyncTest(function*() {
add_task(function*() {
yield addTab(TEST_URI);
let {toolbox, inspector, view} = yield openRuleView();

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

@ -9,7 +9,7 @@
const TEST_URI = TEST_URL_ROOT + "doc_keyframeanimation.html";
let test = asyncTest(function*() {
add_task(function*() {
yield addTab(TEST_URI);
let {toolbox, inspector, view} = yield openRuleView();

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

@ -22,7 +22,7 @@ const TEST_DATA = [
{escape: true, value: "inline", expected: "block"}
];
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,test rule view live preview on user changes");
let style = '#testid {display:block;}';

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

@ -25,7 +25,7 @@ const TEST_URL = [
"</div>"
].join("");
let test = asyncTest(function*() {
add_task(function*() {
yield addTab(TEST_URL);
let {toolbox, inspector, view} = yield openRuleView();

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

@ -9,7 +9,7 @@
const TEST_URI = TEST_URL_ROOT + "doc_media_queries.html";
let test = asyncTest(function*() {
add_task(function*() {
yield addTab(TEST_URI);
let {inspector, view} = yield openRuleView();

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

@ -7,7 +7,7 @@
// Test that the rule-view behaves correctly when entering mutliple and/or
// unfinished properties/values in inplace-editors
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,test rule view user changes");
content.document.body.innerHTML = "<h1>Testing Multiple Properties</h1>";
let {toolbox, inspector, view} = yield openRuleView();

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

@ -7,7 +7,7 @@
// Test that the rule-view behaves correctly when entering mutliple and/or
// unfinished properties/values in inplace-editors
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,test rule view user changes");
content.document.body.innerHTML = "<h1>Testing Multiple Properties</h1>";
let {toolbox, inspector, view} = yield openRuleView();

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

@ -7,7 +7,7 @@
// Test that the rule-view behaves correctly when entering mutliple and/or
// unfinished properties/values in inplace-editors
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,test rule view user changes");
content.document.body.innerHTML = "<h1>Testing Multiple Properties</h1>";
let {toolbox, inspector, view} = yield openRuleView();

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

@ -7,7 +7,7 @@
// Test that the rule-view behaves correctly when entering mutliple and/or
// unfinished properties/values in inplace-editors
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,test rule view user changes");
content.document.body.innerHTML = "<h1>Testing Multiple Properties</h1>";
let {toolbox, inspector, view} = yield openRuleView();

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

@ -7,7 +7,7 @@
// Test that the rule-view behaves correctly when entering mutliple and/or
// unfinished properties/values in inplace-editors
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,test rule view user changes");
content.document.body.innerHTML = "<h1>Testing Multiple Properties</h1>";
let {toolbox, inspector, view} = yield openRuleView();

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

@ -7,7 +7,7 @@
// Test that the rule-view behaves correctly when entering mutliple and/or
// unfinished properties/values in inplace-editors
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,test rule view user changes");
content.document.body.innerHTML = "<h1>Testing Multiple Properties</h1>";
let {toolbox, inspector, view} = yield openRuleView();

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

@ -12,7 +12,7 @@ const PREF = "devtools.styleeditor.source-maps-enabled";
const SCSS_LOC = "doc_sourcemaps.scss:4";
const CSS_LOC = "doc_sourcemaps.css:1";
let test = asyncTest(function*() {
add_task(function*() {
info("Setting the " + PREF + " pref to true");
Services.prefs.setBoolPref(PREF, true);

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

@ -6,7 +6,7 @@
// Test the display of overridden declarations in the rule-view
let test = asyncTest(function*() {
add_task(function*() {
yield addTab("data:text/html;charset=utf-8,browser_ruleview_override.js");
let {toolbox, inspector, view} = yield openRuleView();

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

@ -8,7 +8,7 @@
const TEST_URI = TEST_URL_ROOT + "doc_pseudoelement.html";
let test = asyncTest(function*() {
add_task(function*() {
yield addTab(TEST_URI);
let {toolbox, inspector, view} = yield openRuleView();

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

@ -8,7 +8,7 @@
const TEST_URI = TEST_URL_ROOT + "doc_pseudoelement.html";
let test = asyncTest(function*() {
add_task(function*() {
yield addTab(TEST_URI);
let {toolbox, inspector, view} = yield openRuleView();

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше