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

Side by Side Diff: content/browser/web_contents/web_contents_impl_browsertest.cc

Issue 196283013: Make to call WebContentsImpl::RenderViewCreated() when we create child window. (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: remove "ax_event_notification_details.h" in web_contents_impl.h Created 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/strings/utf_string_conversions.h" 5 #include "base/strings/utf_string_conversions.h"
6 #include "base/values.h" 6 #include "base/values.h"
7 #include "content/browser/frame_host/navigation_entry_impl.h" 7 #include "content/browser/frame_host/navigation_entry_impl.h"
8 #include "content/browser/web_contents/web_contents_impl.h" 8 #include "content/browser/web_contents/web_contents_impl.h"
9 #include "content/browser/web_contents/web_contents_view.h" 9 #include "content/browser/web_contents/web_contents_view.h"
10 #include "content/public/browser/load_notification_details.h" 10 #include "content/public/browser/load_notification_details.h"
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 430
431 // LoadingStateChanged should be called 4 times: start and stop for the 431 // LoadingStateChanged should be called 4 times: start and stop for the
432 // initial load of push_state.html, and start and stop for the "navigation" 432 // initial load of push_state.html, and start and stop for the "navigation"
433 // triggered by history.pushState(). However, the start notification for the 433 // triggered by history.pushState(). However, the start notification for the
434 // history.pushState() navigation should set to_different_document to false. 434 // history.pushState() navigation should set to_different_document to false.
435 EXPECT_EQ("pushState", shell()->web_contents()->GetURL().ref()); 435 EXPECT_EQ("pushState", shell()->web_contents()->GetURL().ref());
436 EXPECT_EQ(4, delegate->loadingStateChangedCount()); 436 EXPECT_EQ(4, delegate->loadingStateChangedCount());
437 EXPECT_EQ(3, delegate->loadingStateToDifferentDocumentCount()); 437 EXPECT_EQ(3, delegate->loadingStateToDifferentDocumentCount());
438 } 438 }
439 439
440 IN_PROC_BROWSER_TEST_F(WebContentsImplBrowserTest,
441 RenderViewCreatedForChildWindow) {
442 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
443
444 NavigateToURL(shell(),
445 embedded_test_server()->GetURL("/title1.html"));
446
447 WebContentsAddedObserver new_web_contents_observer;
448 ASSERT_TRUE(ExecuteScript(shell()->web_contents(),
449 "var a = document.createElement('a');"
450 "a.href='./title2.html';"
451 "a.target = '_blank';"
452 "document.body.appendChild(a);"
453 "a.click();"));
454 WebContents* new_web_contents = new_web_contents_observer.GetWebContents();
455 WaitForLoadStop(new_web_contents);
456 EXPECT_TRUE(new_web_contents_observer.RenderViewCreatedCalled());
457 }
458
440 } // namespace content 459 } // namespace content
441 460
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_impl.cc ('k') | content/public/test/content_browser_test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698