| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/banners/app_banner_data_fetcher.h" | 5 #include "chrome/browser/banners/app_banner_data_fetcher.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 | 58 |
| 59 class AppBannerDataFetcherBrowserTest : public InProcessBrowserTest, | 59 class AppBannerDataFetcherBrowserTest : public InProcessBrowserTest, |
| 60 public AppBannerDataFetcher::Delegate { | 60 public AppBannerDataFetcher::Delegate { |
| 61 public: | 61 public: |
| 62 AppBannerDataFetcherBrowserTest() : weak_factory_(this) { | 62 AppBannerDataFetcherBrowserTest() : weak_factory_(this) { |
| 63 } | 63 } |
| 64 | 64 |
| 65 void SetUpOnMainThread() override { | 65 void SetUpOnMainThread() override { |
| 66 AppBannerSettingsHelper::SetEngagementWeights(1, 1); | 66 AppBannerSettingsHelper::SetEngagementWeights(1, 1); |
| 67 AppBannerSettingsHelper::SetTotalEngagementToTrigger(2); | 67 AppBannerSettingsHelper::SetTotalEngagementToTrigger(2); |
| 68 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 68 ASSERT_TRUE(embedded_test_server()->Start()); |
| 69 InProcessBrowserTest::SetUpOnMainThread(); | 69 InProcessBrowserTest::SetUpOnMainThread(); |
| 70 } | 70 } |
| 71 | 71 |
| 72 bool HandleNonWebApp(const std::string& platform, | 72 bool HandleNonWebApp(const std::string& platform, |
| 73 const GURL& url, | 73 const GURL& url, |
| 74 const std::string& id) override { | 74 const std::string& id) override { |
| 75 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, quit_closure_); | 75 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, quit_closure_); |
| 76 non_web_platform_ = platform; | 76 non_web_platform_ = platform; |
| 77 return false; | 77 return false; |
| 78 } | 78 } |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 RunBannerTest("/banners/prompt_in_handler_test_page.html", | 333 RunBannerTest("/banners/prompt_in_handler_test_page.html", |
| 334 ui::PAGE_TRANSITION_TYPED, 1, true); | 334 ui::PAGE_TRANSITION_TYPED, 1, true); |
| 335 } | 335 } |
| 336 | 336 |
| 337 IN_PROC_BROWSER_TEST_F(AppBannerDataFetcherBrowserTest, WebAppBannerInIFrame) { | 337 IN_PROC_BROWSER_TEST_F(AppBannerDataFetcherBrowserTest, WebAppBannerInIFrame) { |
| 338 RunBannerTest("/banners/iframe_test_page.html", ui::PAGE_TRANSITION_TYPED, 1, | 338 RunBannerTest("/banners/iframe_test_page.html", ui::PAGE_TRANSITION_TYPED, 1, |
| 339 false); | 339 false); |
| 340 } | 340 } |
| 341 | 341 |
| 342 } // namespace banners | 342 } // namespace banners |
| OLD | NEW |