| 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 // Loop through the vector of engagement scores. We only expect the banner | 129 // Loop through the vector of engagement scores. We only expect the banner |
| 130 // pipeline to trigger on the last one; otherwise, nothing is expected to | 130 // pipeline to trigger on the last one; otherwise, nothing is expected to |
| 131 // happen. | 131 // happen. |
| 132 int iterations = 0; | 132 int iterations = 0; |
| 133 SiteEngagementService* service = | 133 SiteEngagementService* service = |
| 134 SiteEngagementService::Get(browser->profile()); | 134 SiteEngagementService::Get(browser->profile()); |
| 135 for (double engagement : engagement_scores) { | 135 for (double engagement : engagement_scores) { |
| 136 if (iterations > 0) { | 136 if (iterations > 0) { |
| 137 ui_test_utils::NavigateToURL(browser, test_url); | 137 ui_test_utils::NavigateToURL(browser, test_url); |
| 138 | 138 |
| 139 EXPECT_EQ(false, manager->will_show()); | 139 EXPECT_FALSE(manager->will_show()); |
| 140 EXPECT_FALSE(manager->is_active()); | 140 EXPECT_FALSE(manager->is_active()); |
| 141 | 141 |
| 142 histograms.ExpectTotalCount(banners::kMinutesHistogram, 0); | 142 histograms.ExpectTotalCount(banners::kMinutesHistogram, 0); |
| 143 histograms.ExpectTotalCount(banners::kInstallableStatusCodeHistogram, | 143 histograms.ExpectTotalCount(banners::kInstallableStatusCodeHistogram, |
| 144 0); | 144 0); |
| 145 } | 145 } |
| 146 service->ResetScoreForURL(test_url, engagement); | 146 service->ResetScoreForURL(test_url, engagement); |
| 147 ++iterations; | 147 ++iterations; |
| 148 } | 148 } |
| 149 | 149 |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 OpenURLOffTheRecord(browser()->profile(), GURL("about:blank")); | 323 OpenURLOffTheRecord(browser()->profile(), GURL("about:blank")); |
| 324 std::unique_ptr<AppBannerManagerTest> manager( | 324 std::unique_ptr<AppBannerManagerTest> manager( |
| 325 CreateAppBannerManager(incognito_browser)); | 325 CreateAppBannerManager(incognito_browser)); |
| 326 std::vector<double> engagement_scores{10}; | 326 std::vector<double> engagement_scores{10}; |
| 327 RunBannerTest(incognito_browser, manager.get(), | 327 RunBannerTest(incognito_browser, manager.get(), |
| 328 "/banners/manifest_test_page.html", engagement_scores, | 328 "/banners/manifest_test_page.html", engagement_scores, |
| 329 IN_INCOGNITO, false); | 329 IN_INCOGNITO, false); |
| 330 } | 330 } |
| 331 | 331 |
| 332 } // namespace banners | 332 } // namespace banners |
| OLD | NEW |