Bug 882538 - Add reload() and navigateTo() methods to BrowserTabActor; r=rcampbell

This commit is contained in:
Panos Astithas 2013-06-28 10:53:00 +03:00
Родитель 5694a6f1ae
Коммит 2897446860
12 изменённых файлов: 83 добавлений и 10 удалений

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

@ -53,7 +53,7 @@ function testLocationChange()
});
});
});
content.location = STACK_URL;
gDebugger.DebuggerController.client.activeTab.navigateTo(STACK_URL);
});
}

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

@ -293,7 +293,7 @@ function test()
});
finalCheck();
gDebuggee.location.reload();
gDebugger.DebuggerController.client.activeTab.reload();
}
function finalCheck() {

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

@ -95,7 +95,7 @@ function testLocationChange()
closeDebuggerAndFinish();
});
});
content.location = "about:blank";
gDebugger.DebuggerController.client.activeTab.navigateTo("about:blank");
});
}

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

@ -103,7 +103,7 @@ function testReloadPage()
clickAgain();
});
content.location.reload();
gDebugger.DebuggerController.client.activeTab.reload();
}
function clickAgain()

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

@ -95,7 +95,8 @@ function testLocationChange()
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();
});
content.location = TAB1_URL;
gDebugger.DebuggerController.client.activeTab.navigateTo(TAB1_URL);
});
}

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

@ -204,7 +204,7 @@ function test()
function reloadPage()
{
gDebuggee.location.reload();
gDebugger.DebuggerController.client.activeTab.reload();
}
registerCleanupFunction(function() {

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

@ -127,7 +127,7 @@ function testLocationChange()
});
});
content.location = TAB1_URL;
gDebugger.DebuggerController.client.activeTab.navigateTo(TAB1_URL);
}
function clear() {

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

@ -108,7 +108,7 @@ function performReload(callback) {
callback();
});
gDebuggee.location.reload();
gDebugger.DebuggerController.client.activeTab.reload();
}
function testStateBeforeReload() {

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

@ -3098,6 +3098,30 @@
"n_buckets": "80 + 1",
"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": {
"kind": "exponential",
"high": "10000",

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

@ -923,6 +923,28 @@ TabClient.prototype = {
},
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);

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

@ -695,6 +695,30 @@ BrowserTabActor.prototype = {
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.
*/
@ -784,7 +808,9 @@ BrowserTabActor.prototype = {
*/
BrowserTabActor.prototype.requestTypes = {
"attach": BrowserTabActor.prototype.onAttach,
"detach": BrowserTabActor.prototype.onDetach
"detach": BrowserTabActor.prototype.onDetach,
"reload": BrowserTabActor.prototype.onReload,
"navigateTo": BrowserTabActor.prototype.onNavigateTo
};
/**