OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/browser/renderer_host/test/test_render_view_host.h" | 5 #include "chrome/browser/renderer_host/test/test_render_view_host.h" |
6 #include "chrome/browser/tab_contents/navigation_controller.h" | 6 #include "chrome/browser/tab_contents/navigation_controller.h" |
7 #include "chrome/browser/tab_contents/navigation_entry.h" | 7 #include "chrome/browser/tab_contents/navigation_entry.h" |
8 #include "chrome/browser/tab_contents/render_view_host_manager.h" | 8 #include "chrome/browser/tab_contents/render_view_host_manager.h" |
9 #include "chrome/common/ipc_message.h" | |
10 #include "chrome/common/render_messages.h" | 9 #include "chrome/common/render_messages.h" |
11 #include "chrome/common/url_constants.h" | 10 #include "chrome/common/url_constants.h" |
12 #include "chrome/test/test_notification_tracker.h" | 11 #include "chrome/test/test_notification_tracker.h" |
| 12 #include "ipc/ipc_message.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
14 | 14 |
15 class RenderViewHostManagerTest : public RenderViewHostTestHarness { | 15 class RenderViewHostManagerTest : public RenderViewHostTestHarness { |
16 public: | 16 public: |
17 void NavigateActiveAndCommit(const GURL& url) { | 17 void NavigateActiveAndCommit(const GURL& url) { |
18 // Note: we navigate the active RenderViewHost because previous navigations | 18 // Note: we navigate the active RenderViewHost because previous navigations |
19 // won't have committed yet, so NavigateAndCommit does the wrong thing | 19 // won't have committed yet, so NavigateAndCommit does the wrong thing |
20 // for us. | 20 // for us. |
21 controller().LoadURL(url, GURL(), 0); | 21 controller().LoadURL(url, GURL(), 0); |
22 active_rvh()->SendNavigate( | 22 active_rvh()->SendNavigate( |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 EXPECT_FALSE(manager.pending_render_view_host()); | 241 EXPECT_FALSE(manager.pending_render_view_host()); |
242 EXPECT_TRUE(manager.pending_dom_ui()); | 242 EXPECT_TRUE(manager.pending_dom_ui()); |
243 EXPECT_FALSE(manager.dom_ui()); | 243 EXPECT_FALSE(manager.dom_ui()); |
244 | 244 |
245 // Commit. | 245 // Commit. |
246 manager.DidNavigateMainFrame(host); | 246 manager.DidNavigateMainFrame(host); |
247 | 247 |
248 EXPECT_FALSE(manager.pending_dom_ui()); | 248 EXPECT_FALSE(manager.pending_dom_ui()); |
249 EXPECT_TRUE(manager.dom_ui()); | 249 EXPECT_TRUE(manager.dom_ui()); |
250 } | 250 } |
OLD | NEW |