Skip to content

Commit

Permalink
Enable some location and history web platform tests
Browse files Browse the repository at this point in the history
  • Loading branch information
domenic committed Jan 27, 2016
1 parent a0b7a09 commit 99103a6
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/jsdom/living/window/History-impl.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ exports.implementation = class HistoryImpl {

// Not implemented: unload a document guard

// Not clear that this should be queued. html/browsers/history/the-history-interface/004.html can be fixed
// by removing the queue, but doing so breaks some tests in history.js that also pass in browsers.
this._queueHistoryTraversalTask(() => traverseHistory(this._window, specifiedEntry));
});
}
Expand Down
21 changes: 21 additions & 0 deletions test/web-platform-tests/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,27 @@ const runWebPlatformTest = require("./run-web-platform-test")(exports, path.reso
"html/browsers/browsing-the-web/history-traversal/PopStateEvent.html",
"html/browsers/browsing-the-web/history-traversal/hashchange_event.html",
"html/browsers/browsing-the-web/history-traversal/popstate_event.html",
// "html/browsers/history/the-history-interface/001.html", // complicated navigation stuff and structured cloning
// "html/browsers/history/the-history-interface/002.html", // complicated navigation stuff and structured cloning
// "html/browsers/history/the-history-interface/004.html", // subtle timing issues that I can't quite figure out; see comment in History-impl.js
"html/browsers/history/the-history-interface/005.html",
"html/browsers/history/the-history-interface/006.html",
// "html/browsers/history/the-history-interface/007.html", // depends on the load event being delayed properly
"html/browsers/history/the-history-interface/008.html",
// "html/browsers/history/the-history-interface/009.html", // complicated navigation stuff for iframes
// "html/browsers/history/the-history-interface/010.html", // complicated navigation stuff for iframes
"html/browsers/history/the-history-interface/011.html",
"html/browsers/history/the-history-interface/012.html",
"html/browsers/history/the-location-interface/document_location.html",
"html/browsers/history/the-location-interface/location-stringifier.html",
"html/browsers/history/the-location-interface/location_hash.html",
"html/browsers/history/the-location-interface/location_host.html",
"html/browsers/history/the-location-interface/location_hostname.html",
"html/browsers/history/the-location-interface/location_href.html",
"html/browsers/history/the-location-interface/location_pathname.html",
"html/browsers/history/the-location-interface/location_port.html",
"html/browsers/history/the-location-interface/location_protocol.html",
"html/browsers/history/the-location-interface/location_search.html",
"html/dom/dynamic-markup-insertion/document-writeln/document.writeln-02.html",
"html/dom/dynamic-markup-insertion/document-writeln/document.writeln-03.html",
"html/dom/elements/global-attributes/classlist-nonstring.html",
Expand Down
7 changes: 6 additions & 1 deletion test/web-platform-tests/run-web-platform-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,12 @@ function createJsdom(urlPrefix, testPath, t) {

window.add_completion_callback((tests, harnessStatus) => {
t.ok(harnessStatus.status !== 2, "test harness should not timeout");
window.close();

// This needs to be delayed since some tests do things even after calling done().
process.nextTick(() => {
window.close();
});

t.done();
});
};
Expand Down

0 comments on commit 99103a6

Please sign in to comment.