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

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
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
dominickn 2017/02/10 03:10:29 Nit: remove the extra newline
ramyasharma 2017/02/15 05:03:36 Done.
264
265 TEST_F(ExternalProtocolHandlerTest, TestClearProfileState) {
266 base::DictionaryValue prefs;
267 prefs.SetBoolean("tel", true);
268 profile_->GetPrefs()->Set(prefs::kExcludedSchemes, prefs);
269 ASSERT_FALSE(
270 profile_->GetPrefs()->GetDictionary(prefs::kExcludedSchemes)->empty());
271 ExternalProtocolHandler::ClearData(profile_.get());
272 ASSERT_TRUE(
273 profile_->GetPrefs()->GetDictionary(prefs::kExcludedSchemes)->empty());
274 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698