OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "app/message_box_flags.h" | 7 #include "app/message_box_flags.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/prefs/pref_service.h" | 10 #include "chrome/browser/prefs/pref_service.h" |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 } | 179 } |
180 | 180 |
181 private: | 181 private: |
182 TestInterstitialPage* interstitial_page_; | 182 TestInterstitialPage* interstitial_page_; |
183 }; | 183 }; |
184 | 184 |
185 class TabContentsTest : public RenderViewHostTestHarness { | 185 class TabContentsTest : public RenderViewHostTestHarness { |
186 public: | 186 public: |
187 TabContentsTest() | 187 TabContentsTest() |
188 : RenderViewHostTestHarness(), | 188 : RenderViewHostTestHarness(), |
189 ui_thread_(ChromeThread::UI, &message_loop_) { | 189 ui_thread_(BrowserThread::UI, &message_loop_) { |
190 } | 190 } |
191 | 191 |
192 private: | 192 private: |
193 // Supply our own profile so we use the correct profile data. The test harness | 193 // Supply our own profile so we use the correct profile data. The test harness |
194 // is not supposed to overwrite a profile if it's already created. | 194 // is not supposed to overwrite a profile if it's already created. |
195 virtual void SetUp() { | 195 virtual void SetUp() { |
196 TestingProfile* profile = new TestingProfile(); | 196 TestingProfile* profile = new TestingProfile(); |
197 profile_.reset(profile); | 197 profile_.reset(profile); |
198 | 198 |
199 // Set some (WebKit) user preferences. | 199 // Set some (WebKit) user preferences. |
(...skipping 17 matching lines...) Expand all Loading... |
217 | 217 |
218 RenderViewHostTestHarness::SetUp(); | 218 RenderViewHostTestHarness::SetUp(); |
219 } | 219 } |
220 | 220 |
221 virtual void TearDown() { | 221 virtual void TearDown() { |
222 RenderViewHostTestHarness::TearDown(); | 222 RenderViewHostTestHarness::TearDown(); |
223 | 223 |
224 profile_.reset(NULL); | 224 profile_.reset(NULL); |
225 } | 225 } |
226 | 226 |
227 ChromeThread ui_thread_; | 227 BrowserThread ui_thread_; |
228 }; | 228 }; |
229 | 229 |
230 // Test to make sure that title updates get stripped of whitespace. | 230 // Test to make sure that title updates get stripped of whitespace. |
231 TEST_F(TabContentsTest, UpdateTitle) { | 231 TEST_F(TabContentsTest, UpdateTitle) { |
232 ViewHostMsg_FrameNavigate_Params params; | 232 ViewHostMsg_FrameNavigate_Params params; |
233 InitNavigateParams(¶ms, 0, GURL(chrome::kAboutBlankURL)); | 233 InitNavigateParams(¶ms, 0, GURL(chrome::kAboutBlankURL)); |
234 | 234 |
235 NavigationController::LoadCommittedDetails details; | 235 NavigationController::LoadCommittedDetails details; |
236 controller().RendererDidNavigate(params, 0, &details); | 236 controller().RendererDidNavigate(params, 0, &details); |
237 | 237 |
(...skipping 1366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1604 | 1604 |
1605 // It should have a transient entry. | 1605 // It should have a transient entry. |
1606 EXPECT_TRUE(other_controller.GetTransientEntry()); | 1606 EXPECT_TRUE(other_controller.GetTransientEntry()); |
1607 | 1607 |
1608 // And the interstitial should be showing. | 1608 // And the interstitial should be showing. |
1609 EXPECT_TRUE(other_contents->showing_interstitial_page()); | 1609 EXPECT_TRUE(other_contents->showing_interstitial_page()); |
1610 | 1610 |
1611 // And the interstitial should do a reload on don't proceed. | 1611 // And the interstitial should do a reload on don't proceed. |
1612 EXPECT_TRUE(other_contents->interstitial_page()->reload_on_dont_proceed()); | 1612 EXPECT_TRUE(other_contents->interstitial_page()->reload_on_dont_proceed()); |
1613 } | 1613 } |
OLD | NEW |