OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 | 108 |
109 DISALLOW_COPY_AND_ASSIGN(AppBannerManagerTest); | 109 DISALLOW_COPY_AND_ASSIGN(AppBannerManagerTest); |
110 }; | 110 }; |
111 | 111 |
112 class AppBannerManagerBrowserTest : public InProcessBrowserTest { | 112 class AppBannerManagerBrowserTest : public InProcessBrowserTest { |
113 public: | 113 public: |
114 void SetUpOnMainThread() override { | 114 void SetUpOnMainThread() override { |
115 AppBannerSettingsHelper::SetTotalEngagementToTrigger(10); | 115 AppBannerSettingsHelper::SetTotalEngagementToTrigger(10); |
116 SiteEngagementScore::SetParamValuesForTesting(); | 116 SiteEngagementScore::SetParamValuesForTesting(); |
117 ASSERT_TRUE(embedded_test_server()->Start()); | 117 ASSERT_TRUE(embedded_test_server()->Start()); |
118 InProcessBrowserTest::SetUpOnMainThread(); | |
119 } | 118 } |
120 | 119 |
121 void SetUpCommandLine(base::CommandLine* command_line) override { | 120 void SetUpCommandLine(base::CommandLine* command_line) override { |
122 // Make sure app banners are disabled in the browser, otherwise they will | 121 // Make sure app banners are disabled in the browser, otherwise they will |
123 // interfere with the test. | 122 // interfere with the test. |
124 command_line->AppendSwitch(switches::kDisableAddToShelf); | 123 command_line->AppendSwitch(switches::kDisableAddToShelf); |
125 } | 124 } |
126 | 125 |
127 protected: | 126 protected: |
128 // Returns a test server URL to page |page_url| with |manifest_url| injected | 127 // Returns a test server URL to page |page_url| with |manifest_url| injected |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
528 EXPECT_FALSE(manager->will_show()); | 527 EXPECT_FALSE(manager->will_show()); |
529 EXPECT_FALSE(manager->is_active_or_pending()); | 528 EXPECT_FALSE(manager->is_active_or_pending()); |
530 EXPECT_FALSE(manager->need_to_log_status()); | 529 EXPECT_FALSE(manager->need_to_log_status()); |
531 | 530 |
532 histograms.ExpectTotalCount(banners::kMinutesHistogram, 0); | 531 histograms.ExpectTotalCount(banners::kMinutesHistogram, 0); |
533 histograms.ExpectUniqueSample(banners::kInstallableStatusCodeHistogram, | 532 histograms.ExpectUniqueSample(banners::kInstallableStatusCodeHistogram, |
534 INSUFFICIENT_ENGAGEMENT, 1); | 533 INSUFFICIENT_ENGAGEMENT, 1); |
535 } | 534 } |
536 | 535 |
537 } // namespace banners | 536 } // namespace banners |
OLD | NEW |