| OLD | NEW |
| 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 <memory> | 5 #include <memory> |
| 6 #include <string> | 6 #include <string> |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 public: | 374 public: |
| 375 LocalNTPOneGoogleBarSmokeTest() {} | 375 LocalNTPOneGoogleBarSmokeTest() {} |
| 376 | 376 |
| 377 protected: | 377 protected: |
| 378 void SetUpCommandLine(base::CommandLine* cmdline) override { | 378 void SetUpCommandLine(base::CommandLine* cmdline) override { |
| 379 cmdline->AppendSwitchASCII(switches::kEnableFeatures, | 379 cmdline->AppendSwitchASCII(switches::kEnableFeatures, |
| 380 "UseGoogleLocalNtp,OneGoogleBarOnLocalNtp"); | 380 "UseGoogleLocalNtp,OneGoogleBarOnLocalNtp"); |
| 381 } | 381 } |
| 382 | 382 |
| 383 void SetUpInProcessBrowserTestFixture() override { | 383 void SetUpInProcessBrowserTestFixture() override { |
| 384 InProcessBrowserTest::SetUpInProcessBrowserTestFixture(); | |
| 385 | |
| 386 will_create_browser_context_services_subscription_ = | 384 will_create_browser_context_services_subscription_ = |
| 387 BrowserContextDependencyManager::GetInstance() | 385 BrowserContextDependencyManager::GetInstance() |
| 388 ->RegisterWillCreateBrowserContextServicesCallbackForTesting( | 386 ->RegisterWillCreateBrowserContextServicesCallbackForTesting( |
| 389 base::Bind(&LocalNTPOneGoogleBarSmokeTest:: | 387 base::Bind(&LocalNTPOneGoogleBarSmokeTest:: |
| 390 OnWillCreateBrowserContextServices, | 388 OnWillCreateBrowserContextServices, |
| 391 base::Unretained(this))); | 389 base::Unretained(this))); |
| 392 } | 390 } |
| 393 | 391 |
| 394 FakeOneGoogleBarFetcher* one_google_bar_fetcher() { | 392 FakeOneGoogleBarFetcher* one_google_bar_fetcher() { |
| 395 return static_cast<FakeOneGoogleBarFetcher*>( | 393 return static_cast<FakeOneGoogleBarFetcher*>( |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 | 464 |
| 467 bool in_head_ran = false; | 465 bool in_head_ran = false; |
| 468 ASSERT_TRUE(instant_test_utils::GetBoolFromJS( | 466 ASSERT_TRUE(instant_test_utils::GetBoolFromJS( |
| 469 active_tab, "!!window.inHeadRan", &in_head_ran)); | 467 active_tab, "!!window.inHeadRan", &in_head_ran)); |
| 470 EXPECT_TRUE(in_head_ran); | 468 EXPECT_TRUE(in_head_ran); |
| 471 bool after_bar_ran = false; | 469 bool after_bar_ran = false; |
| 472 ASSERT_TRUE(instant_test_utils::GetBoolFromJS( | 470 ASSERT_TRUE(instant_test_utils::GetBoolFromJS( |
| 473 active_tab, "!!window.afterBarRan", &after_bar_ran)); | 471 active_tab, "!!window.afterBarRan", &after_bar_ran)); |
| 474 EXPECT_TRUE(after_bar_ran); | 472 EXPECT_TRUE(after_bar_ran); |
| 475 } | 473 } |
| OLD | NEW |