OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/profile_resetter/profile_resetter.h" | 5 #include "chrome/browser/profile_resetter/profile_resetter.h" |
6 | 6 |
7 #include "base/json/json_string_value_serializer.h" | 7 #include "base/json/json_string_value_serializer.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "base/test/scoped_path_override.h" | 10 #include "base/test/scoped_path_override.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "chrome/browser/themes/theme_service_factory.h" | 22 #include "chrome/browser/themes/theme_service_factory.h" |
23 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 23 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
24 #include "chrome/browser/webdata/web_data_service_factory.h" | 24 #include "chrome/browser/webdata/web_data_service_factory.h" |
25 #include "chrome/common/pref_names.h" | 25 #include "chrome/common/pref_names.h" |
26 #include "chrome/test/base/browser_with_test_window_test.h" | 26 #include "chrome/test/base/browser_with_test_window_test.h" |
27 #include "components/google/core/browser/google_pref_names.h" | 27 #include "components/google/core/browser/google_pref_names.h" |
28 #include "components/search_engines/template_url_service.h" | 28 #include "components/search_engines/template_url_service.h" |
29 #include "components/search_engines/template_url_service_client.h" | 29 #include "components/search_engines/template_url_service_client.h" |
30 #include "content/public/browser/web_contents.h" | 30 #include "content/public/browser/web_contents.h" |
31 #include "content/public/test/test_browser_thread.h" | 31 #include "content/public/test/test_browser_thread.h" |
| 32 #include "extensions/common/constants.h" |
32 #include "extensions/common/extension.h" | 33 #include "extensions/common/extension.h" |
33 #include "extensions/common/manifest_constants.h" | 34 #include "extensions/common/manifest_constants.h" |
34 #include "net/http/http_response_headers.h" | 35 #include "net/http/http_response_headers.h" |
35 #include "net/http/http_status_code.h" | 36 #include "net/http/http_status_code.h" |
36 #include "net/url_request/test_url_fetcher_factory.h" | 37 #include "net/url_request/test_url_fetcher_factory.h" |
37 #include "net/url_request/url_request_status.h" | 38 #include "net/url_request/url_request_status.h" |
38 #include "url/gurl.h" | 39 #include "url/gurl.h" |
39 | 40 |
40 #if defined(OS_WIN) | 41 #if defined(OS_WIN) |
41 #include "base/file_util.h" | 42 #include "base/file_util.h" |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 | 487 |
487 EXPECT_TRUE(prefs->GetBoolean(prefs::kHomePageIsNewTabPage)); | 488 EXPECT_TRUE(prefs->GetBoolean(prefs::kHomePageIsNewTabPage)); |
488 EXPECT_EQ("http://www.foo.com", prefs->GetString(prefs::kHomePage)); | 489 EXPECT_EQ("http://www.foo.com", prefs->GetString(prefs::kHomePage)); |
489 EXPECT_FALSE(prefs->GetBoolean(prefs::kShowHomeButton)); | 490 EXPECT_FALSE(prefs->GetBoolean(prefs::kShowHomeButton)); |
490 } | 491 } |
491 | 492 |
492 TEST_F(ProfileResetterTest, ResetContentSettings) { | 493 TEST_F(ProfileResetterTest, ResetContentSettings) { |
493 HostContentSettingsMap* host_content_settings_map = | 494 HostContentSettingsMap* host_content_settings_map = |
494 profile()->GetHostContentSettingsMap(); | 495 profile()->GetHostContentSettingsMap(); |
495 ContentSettingsPattern pattern = | 496 ContentSettingsPattern pattern = |
496 ContentSettingsPattern::FromString("[*.]example.org"); | 497 ContentSettingsPattern::FromString(extensions::kExtensionScheme, |
| 498 "[*.]example.org"); |
497 std::map<ContentSettingsType, ContentSetting> default_settings; | 499 std::map<ContentSettingsType, ContentSetting> default_settings; |
498 | 500 |
499 for (int type = 0; type < CONTENT_SETTINGS_NUM_TYPES; ++type) { | 501 for (int type = 0; type < CONTENT_SETTINGS_NUM_TYPES; ++type) { |
500 if (type == CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE || | 502 if (type == CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE || |
501 type == CONTENT_SETTINGS_TYPE_MIXEDSCRIPT || | 503 type == CONTENT_SETTINGS_TYPE_MIXEDSCRIPT || |
502 type == CONTENT_SETTINGS_TYPE_PROTOCOL_HANDLERS) { | 504 type == CONTENT_SETTINGS_TYPE_PROTOCOL_HANDLERS) { |
503 // These types are excluded because one can't call | 505 // These types are excluded because one can't call |
504 // GetDefaultContentSetting() for them. | 506 // GetDefaultContentSetting() for them. |
505 } else { | 507 } else { |
506 ContentSettingsType content_type = static_cast<ContentSettingsType>(type); | 508 ContentSettingsType content_type = static_cast<ContentSettingsType>(type); |
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1091 new ResettableSettingsSnapshot(profile())); | 1093 new ResettableSettingsSnapshot(profile())); |
1092 deleted_snapshot->RequestShortcuts(base::Bind(&FeedbackCapture::Fail, | 1094 deleted_snapshot->RequestShortcuts(base::Bind(&FeedbackCapture::Fail, |
1093 base::Unretained(&capture))); | 1095 base::Unretained(&capture))); |
1094 deleted_snapshot.reset(); | 1096 deleted_snapshot.reset(); |
1095 // Running remaining tasks shouldn't trigger the callback to be called as | 1097 // Running remaining tasks shouldn't trigger the callback to be called as |
1096 // |deleted_snapshot| was deleted before it could run. | 1098 // |deleted_snapshot| was deleted before it could run. |
1097 base::MessageLoop::current()->RunUntilIdle(); | 1099 base::MessageLoop::current()->RunUntilIdle(); |
1098 } | 1100 } |
1099 | 1101 |
1100 } // namespace | 1102 } // namespace |
OLD | NEW |