| 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 "base/prefs/pref_service.h" | 5 #include "base/prefs/pref_service.h" |
| 6 #include "base/strings/utf_string_conversions.h" | 6 #include "base/strings/utf_string_conversions.h" |
| 7 #include "chrome/browser/browser_process.h" | 7 #include "chrome/browser/browser_process.h" |
| 8 #include "chrome/browser/chrome_notification_types.h" | 8 #include "chrome/browser/chrome_notification_types.h" |
| 9 #include "chrome/browser/content_settings/cookie_settings.h" | 9 #include "chrome/browser/content_settings/cookie_settings.h" |
| 10 #include "chrome/browser/content_settings/host_content_settings_map.h" | 10 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 // The browser might get closed later (and therefore be destroyed), so we | 46 // The browser might get closed later (and therefore be destroyed), so we |
| 47 // save the profile. | 47 // save the profile. |
| 48 profile_ = browser()->profile(); | 48 profile_ = browser()->profile(); |
| 49 | 49 |
| 50 // Closing the last browser window also releases a module reference. Make | 50 // Closing the last browser window also releases a module reference. Make |
| 51 // sure it's not the last one, so the message loop doesn't quit | 51 // sure it's not the last one, so the message loop doesn't quit |
| 52 // unexpectedly. | 52 // unexpectedly. |
| 53 g_browser_process->AddRefModule(); | 53 g_browser_process->AddRefModule(); |
| 54 } | 54 } |
| 55 | 55 |
| 56 virtual void CleanUpOnMainThread() OVERRIDE { | 56 virtual void TearDownOnMainThread() OVERRIDE { |
| 57 // ReleaseBrowserProcessModule() needs to be called in a message loop, so we | 57 // ReleaseBrowserProcessModule() needs to be called in a message loop, so we |
| 58 // post a task to do it, then run the message loop. | 58 // post a task to do it, then run the message loop. |
| 59 base::MessageLoop::current()->PostTask( | 59 base::MessageLoop::current()->PostTask( |
| 60 FROM_HERE, base::Bind(&ReleaseBrowserProcessModule)); | 60 FROM_HERE, base::Bind(&ReleaseBrowserProcessModule)); |
| 61 content::RunAllPendingInMessageLoop(); | 61 content::RunAllPendingInMessageLoop(); |
| 62 | 62 |
| 63 ExtensionApiTest::CleanUpOnMainThread(); | 63 ExtensionApiTest::TearDownOnMainThread(); |
| 64 } | 64 } |
| 65 | 65 |
| 66 protected: | 66 protected: |
| 67 void CheckContentSettingsSet() { | 67 void CheckContentSettingsSet() { |
| 68 HostContentSettingsMap* map = | 68 HostContentSettingsMap* map = |
| 69 profile_->GetHostContentSettingsMap(); | 69 profile_->GetHostContentSettingsMap(); |
| 70 CookieSettings* cookie_settings = | 70 CookieSettings* cookie_settings = |
| 71 CookieSettings::Factory::GetForProfile(profile_).get(); | 71 CookieSettings::Factory::GetForProfile(profile_).get(); |
| 72 | 72 |
| 73 // Check default content settings by using an unknown URL. | 73 // Check default content settings by using an unknown URL. |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 base::FilePath(kBarPath), | 229 base::FilePath(kBarPath), |
| 230 base::ASCIIToUTF16("2.3.4"), | 230 base::ASCIIToUTF16("2.3.4"), |
| 231 base::ASCIIToUTF16("bar")), | 231 base::ASCIIToUTF16("bar")), |
| 232 false); | 232 false); |
| 233 | 233 |
| 234 EXPECT_TRUE(RunExtensionTest("content_settings/getresourceidentifiers")) | 234 EXPECT_TRUE(RunExtensionTest("content_settings/getresourceidentifiers")) |
| 235 << message_; | 235 << message_; |
| 236 } | 236 } |
| 237 | 237 |
| 238 } // namespace extensions | 238 } // namespace extensions |
| OLD | NEW |