Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/resources/testharnessreport.js

Issue 2643613003: Revert "binding: Makes window/frames/self attributes return itself." (Closed)
Patch Set: whack-a-mole Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/dom/Window/property-access-in-closure-after-navigation-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/external/wpt/resources/testharnessreport.js
diff --git a/third_party/WebKit/LayoutTests/external/wpt/resources/testharnessreport.js b/third_party/WebKit/LayoutTests/external/wpt/resources/testharnessreport.js
index ef9f0193e7aa528266b236a9bdb339caf751fc43..e147d46d82e7489b16c091c910720bf066ea1509 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/resources/testharnessreport.js
+++ b/third_party/WebKit/LayoutTests/external/wpt/resources/testharnessreport.js
@@ -213,7 +213,15 @@
results.textContent = resultStr;
function done() {
- if (self.testRunner) {
+ // A temporary workaround since |window.self| property lookup starts
+ // failing if the frame is detached. |output_document| may be an
+ // ancestor of |self| so clearing |textContent| may detach |self|.
+ // To get around this, cache window.self now and use the cached
+ // value.
+ // TODO(dcheng): Remove this hack after fixing window/self/frames
+ // lookup in https://crbug.com/618672
+ var cachedSelf = window.self;
+ if (cachedSelf.testRunner) {
// The following DOM operations may show console messages. We
// suppress them because they are not related to the running
// test.
@@ -237,7 +245,7 @@
}
output_document.body.appendChild(results);
- if (self.testRunner)
+ if (cachedSelf.testRunner)
testRunner.notifyDone();
}
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/dom/Window/property-access-in-closure-after-navigation-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698