| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |