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 17 matching lines...) Expand all Loading... |
28 } | 28 } |
29 | 29 |
30 } // namespace | 30 } // namespace |
31 | 31 |
32 namespace extensions { | 32 namespace extensions { |
33 | 33 |
34 class ExtensionContentSettingsApiTest : public ExtensionApiTest { | 34 class ExtensionContentSettingsApiTest : public ExtensionApiTest { |
35 public: | 35 public: |
36 ExtensionContentSettingsApiTest() : profile_(NULL) {} | 36 ExtensionContentSettingsApiTest() : profile_(NULL) {} |
37 | 37 |
38 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 38 virtual void SetUpCommandLine(CommandLine* command_line) override { |
39 ExtensionApiTest::SetUpCommandLine(command_line); | 39 ExtensionApiTest::SetUpCommandLine(command_line); |
40 command_line->AppendSwitch(switches::kDisablePluginsDiscovery); | 40 command_line->AppendSwitch(switches::kDisablePluginsDiscovery); |
41 } | 41 } |
42 | 42 |
43 virtual void SetUpOnMainThread() OVERRIDE { | 43 virtual void SetUpOnMainThread() override { |
44 ExtensionApiTest::SetUpOnMainThread(); | 44 ExtensionApiTest::SetUpOnMainThread(); |
45 | 45 |
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 TearDownOnMainThread() 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::TearDownOnMainThread(); | 63 ExtensionApiTest::TearDownOnMainThread(); |
64 } | 64 } |
65 | 65 |
66 protected: | 66 protected: |
(...skipping 162 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 |