Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(203)

Side by Side Diff: chrome/browser/banners/app_banner_manager_browsertest.cc

Issue 2735333002: Rename SiteEngagementService::ResetScoreForURL. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_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->ResetBaseScoreForURL(test_url, engagement);
147 ++iterations; 147 ++iterations;
148 } 148 }
149 149
150 // On the final loop, we expect the banner pipeline to trigger - the 150 // On the final loop, we expect the banner pipeline to trigger - the
151 // navigation should generate the final engagement to show the banner. Spin 151 // navigation should generate the final engagement to show the banner. Spin
152 // the run loop, which should be quit by either Stop() or ShowBanner(). 152 // the run loop, which should be quit by either Stop() or ShowBanner().
153 base::RunLoop run_loop; 153 base::RunLoop run_loop;
154 manager->clear_will_show(); 154 manager->clear_will_show();
155 manager->Prepare(run_loop.QuitClosure()); 155 manager->Prepare(run_loop.QuitClosure());
156 ui_test_utils::NavigateToURL(browser, test_url); 156 ui_test_utils::NavigateToURL(browser, test_url);
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698