Chromium Code Reviews| 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/test/simple_test_clock.h" | 6 #include "base/test/simple_test_clock.h" |
| 7 #include "base/values.h" | 7 #include "base/values.h" |
| 8 #include "chrome/browser/engagement/site_engagement_helper.h" | 8 #include "chrome/browser/engagement/site_engagement_helper.h" |
| 9 #include "chrome/browser/engagement/site_engagement_service.h" | 9 #include "chrome/browser/engagement/site_engagement_service.h" |
| 10 #include "chrome/browser/engagement/site_engagement_service_factory.h" | 10 #include "chrome/browser/engagement/site_engagement_service_factory.h" |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 319 | 319 |
| 320 SiteEngagementService* service = | 320 SiteEngagementService* service = |
| 321 SiteEngagementServiceFactory::GetForProfile(profile()); | 321 SiteEngagementServiceFactory::GetForProfile(profile()); |
| 322 DCHECK(service); | 322 DCHECK(service); |
| 323 | 323 |
| 324 GURL url("http://www.google.com/"); | 324 GURL url("http://www.google.com/"); |
| 325 | 325 |
| 326 AddTab(browser(), GURL("about:blank")); | 326 AddTab(browser(), GURL("about:blank")); |
| 327 EXPECT_EQ(0, service->GetScore(url)); | 327 EXPECT_EQ(0, service->GetScore(url)); |
| 328 int prev_score = service->GetScore(url); | 328 int prev_score = service->GetScore(url); |
| 329 int prev_total_score = service->GetTotalEngagementPoints(); | |
| 329 | 330 |
| 330 NavigateAndCommitActiveTab(url); | 331 NavigateAndCommitActiveTab(url); |
| 331 EXPECT_LT(prev_score, service->GetScore(url)); | 332 EXPECT_LT(prev_score, service->GetScore(url)); |
| 332 prev_score = service->GetScore(url); | 333 prev_score = service->GetScore(url); |
| 334 EXPECT_LT(prev_total_score, service->GetTotalEngagementPoints()); | |
| 335 prev_total_score = service->GetTotalEngagementPoints(); | |
| 333 | 336 |
| 334 NavigateAndCommitActiveTab(url); | 337 NavigateAndCommitActiveTab(url); |
| 335 EXPECT_LT(prev_score, service->GetScore(url)); | 338 EXPECT_LT(prev_score, service->GetScore(url)); |
| 339 EXPECT_LT(prev_total_score, service->GetTotalEngagementPoints()); | |
| 336 } | 340 } |
|
raymes
2015/07/01 05:33:09
Could we add a new test where we browse to a bunch
calamity
2015/07/06 01:51:06
Yep, I just needed to check with benwells why this
| |
| OLD | NEW |