зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1361975 Fixing tests in order to support window.location not nullable, r=me
This commit is contained in:
Родитель
a67a0a31e8
Коммит
3477eb3e43
|
@ -2408,14 +2408,17 @@ Toolbox.prototype = {
|
|||
.then(() => {
|
||||
this._removeHostListeners();
|
||||
|
||||
// `location` may already be null if the toolbox document is already
|
||||
// in process of destruction. Otherwise if it is still around, ensure
|
||||
// releasing toolbox document and triggering cleanup thanks to unload
|
||||
// event. We do that precisely here, before nullifying the target as
|
||||
// various cleanup code depends on the target attribute to be still
|
||||
// `location` may already be 'invalid' if the toolbox document is
|
||||
// already in process of destruction. Otherwise if it is still
|
||||
// around, ensure releasing toolbox document and triggering cleanup
|
||||
// thanks to unload event. We do that precisely here, before
|
||||
// nullifying the target as various cleanup code depends on the
|
||||
// target attribute to be still
|
||||
// defined.
|
||||
if (win.location) {
|
||||
try {
|
||||
win.location.replace("about:blank");
|
||||
} catch(e) {
|
||||
// Do nothing;
|
||||
}
|
||||
|
||||
// Targets need to be notified that the toolbox is being torn down.
|
||||
|
|
|
@ -32,7 +32,7 @@ f.remove();
|
|||
// Check that location is now null. If it's not, the test needs changing
|
||||
// (e.g. to use window.close() so that it's null).
|
||||
is("location" in win, true, "Should still have a location property");
|
||||
is(win.location, null, "There should be no location object now");
|
||||
ok(!!win.location, "Location should not be null");
|
||||
|
||||
// Just set the location. This should not crash but throw an exception.
|
||||
var noException;
|
||||
|
@ -47,8 +47,7 @@ todo(noException, "Shouldn't throw when setting location.");
|
|||
|
||||
// And check that we didn't override the slot in the process.
|
||||
is(typeof(win.location), "object", "Location should not have become a string");
|
||||
is(win.location, null,
|
||||
"There should be no location object for real after the set");
|
||||
ok(!!win.location, "Location should not be null");
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
|
|
Загрузка…
Ссылка в новой задаче