| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/browser_thread.h" | |
| 6 #include "chrome/browser/renderer_host/site_instance.h" | |
| 7 #include "chrome/browser/renderer_host/test/test_render_view_host.h" | |
| 8 #include "chrome/browser/tab_contents/navigation_controller.h" | |
| 9 #include "chrome/browser/tab_contents/test_tab_contents.h" | |
| 10 #include "chrome/browser/webui/new_tab_ui.h" | 5 #include "chrome/browser/webui/new_tab_ui.h" |
| 11 #include "chrome/common/url_constants.h" | 6 #include "chrome/common/url_constants.h" |
| 12 #include "chrome/test/testing_profile.h" | 7 #include "chrome/test/testing_profile.h" |
| 8 #include "content/browser/browser_thread.h" |
| 9 #include "content/browser/renderer_host/test_render_view_host.h" |
| 10 #include "content/browser/site_instance.h" |
| 11 #include "content/browser/tab_contents/navigation_controller.h" |
| 12 #include "content/browser/tab_contents/test_tab_contents.h" |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 14 | 14 |
| 15 class WebUITest : public RenderViewHostTestHarness { | 15 class WebUITest : public RenderViewHostTestHarness { |
| 16 public: | 16 public: |
| 17 WebUITest() : ui_thread_(BrowserThread::UI, MessageLoop::current()) {} | 17 WebUITest() : ui_thread_(BrowserThread::UI, MessageLoop::current()) {} |
| 18 | 18 |
| 19 // Tests navigating with a Web UI from a fresh (nothing pending or committed) | 19 // Tests navigating with a Web UI from a fresh (nothing pending or committed) |
| 20 // state, through pending, committed, then another navigation. The first page | 20 // state, through pending, committed, then another navigation. The first page |
| 21 // ID that we should use is passed as a parameter. We'll use the next two | 21 // ID that we should use is passed as a parameter. We'll use the next two |
| 22 // values. This must be increasing for the life of the tests. | 22 // values. This must be increasing for the life of the tests. |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 | 190 |
| 191 // Navigate forward. Shouldn't focus the location bar. | 191 // Navigate forward. Shouldn't focus the location bar. |
| 192 focus_called = tc->focus_called(); | 192 focus_called = tc->focus_called(); |
| 193 ASSERT_TRUE(controller().CanGoForward()); | 193 ASSERT_TRUE(controller().CanGoForward()); |
| 194 controller().GoForward(); | 194 controller().GoForward(); |
| 195 pending_rvh()->SendNavigate(next_page_id, next_url); | 195 pending_rvh()->SendNavigate(next_page_id, next_url); |
| 196 EXPECT_EQ(focus_called, tc->focus_called()); | 196 EXPECT_EQ(focus_called, tc->focus_called()); |
| 197 | 197 |
| 198 contents_.swap(tc_scoped_ptr); | 198 contents_.swap(tc_scoped_ptr); |
| 199 } | 199 } |
| OLD | NEW |