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

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

Issue 2663783002: [Sync] Split encryption state and logic out of PSS and SBHI. (Closed)
Patch Set: Tweak comment. Created 3 years, 10 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
« no previous file with comments | « no previous file | components/browser_sync/profile_sync_service.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "components/omnibox/browser/search_provider.h" 5 #include "components/omnibox/browser/search_provider.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 3245 matching lines...) Expand 10 before | Expand all | Expand 10 after
3256 GURL("http://www.google.com/search"), 3256 GURL("http://www.google.com/search"),
3257 GURL("https://www.google.com/complete/search"), &google_template_url, 3257 GURL("https://www.google.com/complete/search"), &google_template_url,
3258 metrics::OmniboxEventProto::OTHER, SearchTermsData(), &client)); 3258 metrics::OmniboxEventProto::OTHER, SearchTermsData(), &client));
3259 profile_.GetPrefs()->SetBoolean(syncer::prefs::kSyncTabs, true); 3259 profile_.GetPrefs()->SetBoolean(syncer::prefs::kSyncTabs, true);
3260 3260
3261 // Tab sync is encrypted. 3261 // Tab sync is encrypted.
3262 browser_sync::ProfileSyncService* service = 3262 browser_sync::ProfileSyncService* service =
3263 ProfileSyncServiceFactory::GetInstance()->GetForProfile(&profile_); 3263 ProfileSyncServiceFactory::GetInstance()->GetForProfile(&profile_);
3264 syncer::ModelTypeSet encrypted_types = service->GetEncryptedDataTypes(); 3264 syncer::ModelTypeSet encrypted_types = service->GetEncryptedDataTypes();
3265 encrypted_types.Put(syncer::SESSIONS); 3265 encrypted_types.Put(syncer::SESSIONS);
3266 service->OnEncryptedTypesChanged(encrypted_types, false); 3266 service->GetEncryptionObserverForTest()->OnEncryptedTypesChanged(
3267 encrypted_types, false);
3267 EXPECT_FALSE(SearchProvider::CanSendURL( 3268 EXPECT_FALSE(SearchProvider::CanSendURL(
3268 GURL("http://www.google.com/search"), 3269 GURL("http://www.google.com/search"),
3269 GURL("https://www.google.com/complete/search"), &google_template_url, 3270 GURL("https://www.google.com/complete/search"), &google_template_url,
3270 metrics::OmniboxEventProto::OTHER, SearchTermsData(), &client)); 3271 metrics::OmniboxEventProto::OTHER, SearchTermsData(), &client));
3271 encrypted_types.Remove(syncer::SESSIONS); 3272 encrypted_types.Remove(syncer::SESSIONS);
3272 service->OnEncryptedTypesChanged(encrypted_types, false); 3273 service->GetEncryptionObserverForTest()->OnEncryptedTypesChanged(
3274 encrypted_types, false);
3273 3275
3274 // Check that there were no side effects from previous tests. 3276 // Check that there were no side effects from previous tests.
3275 EXPECT_TRUE(SearchProvider::CanSendURL( 3277 EXPECT_TRUE(SearchProvider::CanSendURL(
3276 GURL("http://www.google.com/search"), 3278 GURL("http://www.google.com/search"),
3277 GURL("https://www.google.com/complete/search"), &google_template_url, 3279 GURL("https://www.google.com/complete/search"), &google_template_url,
3278 metrics::OmniboxEventProto::OTHER, SearchTermsData(), &client)); 3280 metrics::OmniboxEventProto::OTHER, SearchTermsData(), &client));
3279 } 3281 }
3280 3282
3281 TEST_F(SearchProviderTest, TestDeleteMatch) { 3283 TEST_F(SearchProviderTest, TestDeleteMatch) {
3282 AutocompleteMatch match( 3284 AutocompleteMatch match(
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
3514 } 3516 }
3515 3517
3516 TEST_F(SearchProviderTest, DoesNotProvideOnFocus) { 3518 TEST_F(SearchProviderTest, DoesNotProvideOnFocus) {
3517 AutocompleteInput input( 3519 AutocompleteInput input(
3518 base::ASCIIToUTF16("f"), base::string16::npos, std::string(), GURL(), 3520 base::ASCIIToUTF16("f"), base::string16::npos, std::string(), GURL(),
3519 metrics::OmniboxEventProto::INVALID_SPEC, false, true, true, true, true, 3521 metrics::OmniboxEventProto::INVALID_SPEC, false, true, true, true, true,
3520 ChromeAutocompleteSchemeClassifier(&profile_)); 3522 ChromeAutocompleteSchemeClassifier(&profile_));
3521 provider_->Start(input, false); 3523 provider_->Start(input, false);
3522 EXPECT_TRUE(provider_->matches().empty()); 3524 EXPECT_TRUE(provider_->matches().empty());
3523 } 3525 }
OLDNEW
« no previous file with comments | « no previous file | components/browser_sync/profile_sync_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698