зеркало из https://github.com/mozilla/gecko-dev.git
Bug 882538 - Add reload() and navigateTo() methods to BrowserTabActor; r=rcampbell
This commit is contained in:
Родитель
5694a6f1ae
Коммит
2897446860
|
@ -53,7 +53,7 @@ function testLocationChange()
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
content.location = STACK_URL;
|
gDebugger.DebuggerController.client.activeTab.navigateTo(STACK_URL);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -293,7 +293,7 @@ function test()
|
||||||
});
|
});
|
||||||
|
|
||||||
finalCheck();
|
finalCheck();
|
||||||
gDebuggee.location.reload();
|
gDebugger.DebuggerController.client.activeTab.reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
function finalCheck() {
|
function finalCheck() {
|
||||||
|
|
|
@ -95,7 +95,7 @@ function testLocationChange()
|
||||||
closeDebuggerAndFinish();
|
closeDebuggerAndFinish();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
content.location = "about:blank";
|
gDebugger.DebuggerController.client.activeTab.navigateTo("about:blank");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -103,7 +103,7 @@ function testReloadPage()
|
||||||
clickAgain();
|
clickAgain();
|
||||||
});
|
});
|
||||||
|
|
||||||
content.location.reload();
|
gDebugger.DebuggerController.client.activeTab.reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
function clickAgain()
|
function clickAgain()
|
||||||
|
|
|
@ -95,7 +95,8 @@ function testLocationChange()
|
||||||
closeDebuggerAndFinish();
|
closeDebuggerAndFinish();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
content.location = EXAMPLE_URL + "browser_dbg_iframes.html";
|
let newLocation = EXAMPLE_URL + "browser_dbg_iframes.html";
|
||||||
|
gDebugger.DebuggerController.client.activeTab.navigateTo(newLocation);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ function testLocationChange()
|
||||||
|
|
||||||
closeDebuggerAndFinish();
|
closeDebuggerAndFinish();
|
||||||
});
|
});
|
||||||
content.location = TAB1_URL;
|
gDebugger.DebuggerController.client.activeTab.navigateTo(TAB1_URL);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -204,7 +204,7 @@ function test()
|
||||||
|
|
||||||
function reloadPage()
|
function reloadPage()
|
||||||
{
|
{
|
||||||
gDebuggee.location.reload();
|
gDebugger.DebuggerController.client.activeTab.reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
registerCleanupFunction(function() {
|
registerCleanupFunction(function() {
|
||||||
|
|
|
@ -127,7 +127,7 @@ function testLocationChange()
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
content.location = TAB1_URL;
|
gDebugger.DebuggerController.client.activeTab.navigateTo(TAB1_URL);
|
||||||
}
|
}
|
||||||
|
|
||||||
function clear() {
|
function clear() {
|
||||||
|
|
|
@ -108,7 +108,7 @@ function performReload(callback) {
|
||||||
callback();
|
callback();
|
||||||
});
|
});
|
||||||
|
|
||||||
gDebuggee.location.reload();
|
gDebugger.DebuggerController.client.activeTab.reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
function testStateBeforeReload() {
|
function testStateBeforeReload() {
|
||||||
|
|
|
@ -3098,6 +3098,30 @@
|
||||||
"n_buckets": "80 + 1",
|
"n_buckets": "80 + 1",
|
||||||
"description": "The time (in milliseconds) after showing a PopupNotification that the mainAction was first triggered"
|
"description": "The time (in milliseconds) after showing a PopupNotification that the mainAction was first triggered"
|
||||||
},
|
},
|
||||||
|
"DEVTOOLS_DEBUGGER_RDP_LOCAL_RELOAD_MS": {
|
||||||
|
"kind": "exponential",
|
||||||
|
"high": "10000",
|
||||||
|
"n_buckets": "1000",
|
||||||
|
"description": "The time (in milliseconds) that it took a 'reload' request to go round trip."
|
||||||
|
},
|
||||||
|
"DEVTOOLS_DEBUGGER_RDP_REMOTE_RELOAD_MS": {
|
||||||
|
"kind": "exponential",
|
||||||
|
"high": "10000",
|
||||||
|
"n_buckets": "1000",
|
||||||
|
"description": "The time (in milliseconds) that it took a 'reload' request to go round trip."
|
||||||
|
},
|
||||||
|
"DEVTOOLS_DEBUGGER_RDP_LOCAL_NAVIGATETO_MS": {
|
||||||
|
"kind": "exponential",
|
||||||
|
"high": "10000",
|
||||||
|
"n_buckets": "1000",
|
||||||
|
"description": "The time (in milliseconds) that it took a 'navigateTo' request to go round trip."
|
||||||
|
},
|
||||||
|
"DEVTOOLS_DEBUGGER_RDP_REMOTE_NAVIGATETO_MS": {
|
||||||
|
"kind": "exponential",
|
||||||
|
"high": "10000",
|
||||||
|
"n_buckets": "1000",
|
||||||
|
"description": "The time (in milliseconds) that it took a 'navigateTo' request to go round trip."
|
||||||
|
},
|
||||||
"DEVTOOLS_DEBUGGER_RDP_LOCAL_DETACH_MS": {
|
"DEVTOOLS_DEBUGGER_RDP_LOCAL_DETACH_MS": {
|
||||||
"kind": "exponential",
|
"kind": "exponential",
|
||||||
"high": "10000",
|
"high": "10000",
|
||||||
|
|
|
@ -923,6 +923,28 @@ TabClient.prototype = {
|
||||||
},
|
},
|
||||||
telemetry: "TABDETACH"
|
telemetry: "TABDETACH"
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reload the page in this tab.
|
||||||
|
*/
|
||||||
|
reload: DebuggerClient.requester({
|
||||||
|
type: "reload"
|
||||||
|
}, {
|
||||||
|
telemetry: "RELOAD"
|
||||||
|
}),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Navigate to another URL.
|
||||||
|
*
|
||||||
|
* @param string url
|
||||||
|
* The URL to navigate to.
|
||||||
|
*/
|
||||||
|
navigateTo: DebuggerClient.requester({
|
||||||
|
type: "navigateTo",
|
||||||
|
url: args(0)
|
||||||
|
}, {
|
||||||
|
telemetry: "NAVIGATETO"
|
||||||
|
}),
|
||||||
};
|
};
|
||||||
|
|
||||||
eventSource(TabClient.prototype);
|
eventSource(TabClient.prototype);
|
||||||
|
|
|
@ -695,6 +695,30 @@ BrowserTabActor.prototype = {
|
||||||
return { type: "detached" };
|
return { type: "detached" };
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reload the page in this tab.
|
||||||
|
*/
|
||||||
|
onReload: function(aRequest) {
|
||||||
|
// Wait a tick so that the response packet can be dispatched before the
|
||||||
|
// subsequent navigation event packet.
|
||||||
|
Services.tm.currentThread.dispatch(makeInfallible(() => {
|
||||||
|
this.contentWindow.location.reload();
|
||||||
|
}, "BrowserTabActor.prototype.onReload's delayed body"), 0);
|
||||||
|
return {};
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Navigate this tab to a new location
|
||||||
|
*/
|
||||||
|
onNavigateTo: function(aRequest) {
|
||||||
|
// Wait a tick so that the response packet can be dispatched before the
|
||||||
|
// subsequent navigation event packet.
|
||||||
|
Services.tm.currentThread.dispatch(makeInfallible(() => {
|
||||||
|
this.contentWindow.location = aRequest.url;
|
||||||
|
}, "BrowserTabActor.prototype.onNavigateTo's delayed body"), 0);
|
||||||
|
return {};
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prepare to enter a nested event loop by disabling debuggee events.
|
* Prepare to enter a nested event loop by disabling debuggee events.
|
||||||
*/
|
*/
|
||||||
|
@ -784,7 +808,9 @@ BrowserTabActor.prototype = {
|
||||||
*/
|
*/
|
||||||
BrowserTabActor.prototype.requestTypes = {
|
BrowserTabActor.prototype.requestTypes = {
|
||||||
"attach": BrowserTabActor.prototype.onAttach,
|
"attach": BrowserTabActor.prototype.onAttach,
|
||||||
"detach": BrowserTabActor.prototype.onDetach
|
"detach": BrowserTabActor.prototype.onDetach,
|
||||||
|
"reload": BrowserTabActor.prototype.onReload,
|
||||||
|
"navigateTo": BrowserTabActor.prototype.onNavigateTo
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Загрузка…
Ссылка в новой задаче