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

Side by Side Diff: chrome/browser/external_protocol/external_protocol_handler_unittest.cc

Issue 2664253006: Clears out external protocol data when cookies and site data is cleared. (Closed)
Patch Set: a 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 | « chrome/browser/external_protocol/external_protocol_handler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/external_protocol/external_protocol_handler.h" 5 #include "chrome/browser/external_protocol/external_protocol_handler.h"
6 6
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "chrome/browser/prefs/browser_prefs.h" 9 #include "chrome/browser/prefs/browser_prefs.h"
10 #include "chrome/common/pref_names.h" 10 #include "chrome/common/pref_names.h"
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 base::DictionaryValue prefs_local; 253 base::DictionaryValue prefs_local;
254 prefs_local.SetBoolean("tel", false); 254 prefs_local.SetBoolean("tel", false);
255 local_state_->Set(prefs::kExcludedSchemes, prefs_local); 255 local_state_->Set(prefs::kExcludedSchemes, prefs_local);
256 ExternalProtocolHandler::BlockState block_state = 256 ExternalProtocolHandler::BlockState block_state =
257 ExternalProtocolHandler::GetBlockState("tel", profile_.get()); 257 ExternalProtocolHandler::GetBlockState("tel", profile_.get());
258 ASSERT_EQ(ExternalProtocolHandler::DONT_BLOCK, block_state); 258 ASSERT_EQ(ExternalProtocolHandler::DONT_BLOCK, block_state);
259 ASSERT_TRUE(local_state_->GetDictionary(prefs::kExcludedSchemes)->empty()); 259 ASSERT_TRUE(local_state_->GetDictionary(prefs::kExcludedSchemes)->empty());
260 ASSERT_FALSE( 260 ASSERT_FALSE(
261 profile_->GetPrefs()->GetDictionary(prefs::kExcludedSchemes)->empty()); 261 profile_->GetPrefs()->GetDictionary(prefs::kExcludedSchemes)->empty());
262 } 262 }
263
264 TEST_F(ExternalProtocolHandlerTest, TestClearProfileState) {
265 base::DictionaryValue prefs;
266 prefs.SetBoolean("tel", true);
267 profile_->GetPrefs()->Set(prefs::kExcludedSchemes, prefs);
268 ASSERT_FALSE(
269 profile_->GetPrefs()->GetDictionary(prefs::kExcludedSchemes)->empty());
270 ExternalProtocolHandler::ClearData(profile_.get());
271 ASSERT_TRUE(
272 profile_->GetPrefs()->GetDictionary(prefs::kExcludedSchemes)->empty());
273 }
OLDNEW
« no previous file with comments | « chrome/browser/external_protocol/external_protocol_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698