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

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

Issue 2510803003: Pass RapporService to content/browser/ (Closed)
Patch Set: Add a test for the current url API Created 4 years, 1 month 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/macros.h" 5 #include "base/macros.h"
6 #include "base/run_loop.h" 6 #include "base/run_loop.h"
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "content/browser/frame_host/navigation_entry_impl.h" 10 #include "content/browser/frame_host/navigation_entry_impl.h"
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 main_frame->OnMessageReceived(progress_msg); 619 main_frame->OnMessageReceived(progress_msg);
620 EXPECT_TRUE(delegate->did_start_loading); 620 EXPECT_TRUE(delegate->did_start_loading);
621 EXPECT_FALSE(delegate->did_stop_loading); 621 EXPECT_FALSE(delegate->did_stop_loading);
622 622
623 // Now interrupt with a new cross-process navigation. 623 // Now interrupt with a new cross-process navigation.
624 TestNavigationObserver tab_observer(shell()->web_contents(), 1); 624 TestNavigationObserver tab_observer(shell()->web_contents(), 1);
625 GURL url(embedded_test_server()->GetURL("foo.com", "/title2.html")); 625 GURL url(embedded_test_server()->GetURL("foo.com", "/title2.html"));
626 shell()->LoadURL(url); 626 shell()->LoadURL(url);
627 tab_observer.Wait(); 627 tab_observer.Wait();
628 EXPECT_EQ(url, shell()->web_contents()->GetLastCommittedURL()); 628 EXPECT_EQ(url, shell()->web_contents()->GetLastCommittedURL());
629 EXPECT_EQ(std::string("foo.com"),
630 static_cast<WebContentsImpl*>(shell()->web_contents())
631 ->getRapporCommittedUrl());
Charlie Reis 2016/11/16 23:55:22 This doesn't seem related to this test. We should
Navid Zolghadr 2016/12/01 18:27:15 Done.
629 632
630 // We should have gotten to DidStopLoading. 633 // We should have gotten to DidStopLoading.
631 EXPECT_TRUE(delegate->did_stop_loading); 634 EXPECT_TRUE(delegate->did_stop_loading);
632 635
633 ResourceDispatcherHost::Get()->SetDelegate(nullptr); 636 ResourceDispatcherHost::Get()->SetDelegate(nullptr);
634 } 637 }
635 638
636 struct FirstVisuallyNonEmptyPaintObserver : public WebContentsObserver { 639 struct FirstVisuallyNonEmptyPaintObserver : public WebContentsObserver {
637 FirstVisuallyNonEmptyPaintObserver(Shell* shell) 640 FirstVisuallyNonEmptyPaintObserver(Shell* shell)
638 : WebContentsObserver(shell->web_contents()), 641 : WebContentsObserver(shell->web_contents()),
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after
1298 // Make sure the WebContents cleaned up the previous pending request. A new 1301 // Make sure the WebContents cleaned up the previous pending request. A new
1299 // request should be forwarded to the WebContentsDelegate. 1302 // request should be forwarded to the WebContentsDelegate.
1300 delegate.get()->request_to_lock_mouse_called_ = false; 1303 delegate.get()->request_to_lock_mouse_called_ = false;
1301 ASSERT_TRUE(ExecuteScript(shell(), 1304 ASSERT_TRUE(ExecuteScript(shell(),
1302 "window.domAutomationController.send(document.body." 1305 "window.domAutomationController.send(document.body."
1303 "requestPointerLock());")); 1306 "requestPointerLock());"));
1304 EXPECT_TRUE(delegate.get()->request_to_lock_mouse_called_); 1307 EXPECT_TRUE(delegate.get()->request_to_lock_mouse_called_);
1305 } 1308 }
1306 1309
1307 } // namespace content 1310 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698