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

Side by Side Diff: chrome/browser/autocomplete/search_provider_unittest.cc

Issue 412943002: Move variations component code to variations namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/autocomplete/search_provider.h" 5 #include "chrome/browser/autocomplete/search_provider.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/metrics/field_trial.h" 10 #include "base/metrics/field_trial.h"
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 "Case #" << i << ": " << error_description; 460 "Case #" << i << ": " << error_description;
461 } 461 }
462 } 462 }
463 463
464 void SearchProviderTest::ResetFieldTrialList() { 464 void SearchProviderTest::ResetFieldTrialList() {
465 // Destroy the existing FieldTrialList before creating a new one to avoid 465 // Destroy the existing FieldTrialList before creating a new one to avoid
466 // a DCHECK. 466 // a DCHECK.
467 field_trial_list_.reset(); 467 field_trial_list_.reset();
468 field_trial_list_.reset(new base::FieldTrialList( 468 field_trial_list_.reset(new base::FieldTrialList(
469 new metrics::SHA1EntropyProvider("foo"))); 469 new metrics::SHA1EntropyProvider("foo")));
470 chrome_variations::testing::ClearAllVariationParams(); 470 variations::testing::ClearAllVariationParams();
471 base::FieldTrial* trial = base::FieldTrialList::CreateFieldTrial( 471 base::FieldTrial* trial = base::FieldTrialList::CreateFieldTrial(
472 "AutocompleteDynamicTrial_0", "DefaultGroup"); 472 "AutocompleteDynamicTrial_0", "DefaultGroup");
473 trial->group(); 473 trial->group();
474 } 474 }
475 475
476 base::FieldTrial* SearchProviderTest::CreateZeroSuggestFieldTrial( 476 base::FieldTrial* SearchProviderTest::CreateZeroSuggestFieldTrial(
477 bool enabled) { 477 bool enabled) {
478 std::map<std::string, std::string> params; 478 std::map<std::string, std::string> params;
479 params[std::string(OmniboxFieldTrial::kZeroSuggestRule)] = enabled ? 479 params[std::string(OmniboxFieldTrial::kZeroSuggestRule)] = enabled ?
480 "true" : "false"; 480 "true" : "false";
481 chrome_variations::AssociateVariationParams( 481 variations::AssociateVariationParams(
482 OmniboxFieldTrial::kBundledExperimentFieldTrialName, "A", params); 482 OmniboxFieldTrial::kBundledExperimentFieldTrialName, "A", params);
483 return base::FieldTrialList::CreateFieldTrial( 483 return base::FieldTrialList::CreateFieldTrial(
484 OmniboxFieldTrial::kBundledExperimentFieldTrialName, "A"); 484 OmniboxFieldTrial::kBundledExperimentFieldTrialName, "A");
485 } 485 }
486 486
487 void SearchProviderTest::ClearAllResults() { 487 void SearchProviderTest::ClearAllResults() {
488 provider_->ClearAllResults(); 488 provider_->ClearAllResults();
489 } 489 }
490 490
491 // Actual Tests --------------------------------------------------------------- 491 // Actual Tests ---------------------------------------------------------------
(...skipping 2724 matching lines...) Expand 10 before | Expand all | Expand 10 after
3216 3216
3217 // The expiration time is always updated. 3217 // The expiration time is always updated.
3218 provider_->GetSessionToken(); 3218 provider_->GetSessionToken();
3219 base::TimeTicks expiration_time_1 = provider_->token_expiration_time_; 3219 base::TimeTicks expiration_time_1 = provider_->token_expiration_time_;
3220 base::PlatformThread::Sleep(kSmallDelta); 3220 base::PlatformThread::Sleep(kSmallDelta);
3221 provider_->GetSessionToken(); 3221 provider_->GetSessionToken();
3222 base::TimeTicks expiration_time_2 = provider_->token_expiration_time_; 3222 base::TimeTicks expiration_time_2 = provider_->token_expiration_time_;
3223 EXPECT_GT(expiration_time_2, expiration_time_1); 3223 EXPECT_GT(expiration_time_2, expiration_time_1);
3224 EXPECT_GE(expiration_time_2, expiration_time_1 + kSmallDelta); 3224 EXPECT_GE(expiration_time_2, expiration_time_1 + kSmallDelta);
3225 } 3225 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698