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

Unified Diff: webkit/tools/test_shell/test_shell.cc

Issue 115575: Move ExtraData from WebRequest to WebDataSource.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 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
Index: webkit/tools/test_shell/test_shell.cc
===================================================================
--- webkit/tools/test_shell/test_shell.cc (revision 16382)
+++ webkit/tools/test_shell/test_shell.cc (working copy)
@@ -510,8 +510,13 @@
if (!reload)
request->SetHistoryState(entry.GetContentState());
- request->SetExtraData(
- new TestShellExtraRequestData(entry.GetPageID()));
+ // A navigation resulting from loading a javascript URL should not be
+ // treated as a browser initiated event. Instead, we want it to look as if
+ // the page initiated any load resulting from JS execution.
+ if (!entry.GetURL().SchemeIs("javascript")) {
+ delegate_->set_pending_extra_data(
+ new TestShellExtraData(entry.GetPageID()));
+ }
// Get the right target frame for the entry.
WebFrame* frame = webView()->GetMainFrame();
@@ -521,6 +526,10 @@
// back/forward navigations maintain the target frame?
frame->LoadRequest(request.get());
+
+ // In case LoadRequest failed before DidCreateDataSource was called.
+ delegate_->set_pending_extra_data(NULL);
+
// Restore focus to the main frame prior to loading new request.
// This makes sure that we don't have a focused iframe. Otherwise, that
// iframe would keep focus when the SetFocus called immediately after

Powered by Google App Engine
This is Rietveld 408576698