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/stringprintf.h" | 5 #include "base/stringprintf.h" |
6 #include "base/utf_string_conversions.h" | 6 #include "base/utf_string_conversions.h" |
7 #include "chrome/browser/background/background_contents_service.h" | 7 #include "chrome/browser/background/background_contents_service.h" |
8 #include "chrome/browser/background/background_contents_service_factory.h" | 8 #include "chrome/browser/background/background_contents_service_factory.h" |
9 #include "chrome/browser/background/background_mode_manager.h" | 9 #include "chrome/browser/background/background_mode_manager.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
11 #include "chrome/browser/extensions/extension_apitest.h" | 11 #include "chrome/browser/extensions/extension_apitest.h" |
12 #include "chrome/browser/extensions/extension_service.h" | 12 #include "chrome/browser/extensions/extension_service.h" |
13 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
14 #include "chrome/browser/ui/browser.h" | 14 #include "chrome/browser/ui/browser.h" |
15 #include "chrome/common/chrome_notification_types.h" | 15 #include "chrome/common/chrome_notification_types.h" |
16 #include "chrome/common/chrome_switches.h" | 16 #include "chrome/common/chrome_switches.h" |
17 #include "chrome/common/extensions/extension.h" | 17 #include "chrome/common/extensions/extension.h" |
18 #include "content/public/browser/notification_service.h" | 18 #include "content/public/browser/notification_service.h" |
19 #include "content/public/test/test_notification_tracker.h" | 19 #include "content/public/test/test_notification_tracker.h" |
20 #include "content/public/test/test_utils.h" | 20 #include "content/public/test/test_utils.h" |
21 #include "net/base/mock_host_resolver.h" | 21 #include "net/dns/mock_host_resolver.h" |
22 | 22 |
23 using extensions::Extension; | 23 using extensions::Extension; |
24 | 24 |
25 class AppBackgroundPageApiTest : public ExtensionApiTest { | 25 class AppBackgroundPageApiTest : public ExtensionApiTest { |
26 public: | 26 public: |
27 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 27 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
28 ExtensionApiTest::SetUpCommandLine(command_line); | 28 ExtensionApiTest::SetUpCommandLine(command_line); |
29 command_line->AppendSwitch(switches::kDisablePopupBlocking); | 29 command_line->AppendSwitch(switches::kDisablePopupBlocking); |
30 command_line->AppendSwitch(switches::kAllowHTTPBackgroundPage); | 30 command_line->AppendSwitch(switches::kAllowHTTPBackgroundPage); |
31 } | 31 } |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 BackgroundContentsServiceFactory::GetForProfile(browser()->profile())-> | 405 BackgroundContentsServiceFactory::GetForProfile(browser()->profile())-> |
406 GetAppBackgroundContents(ASCIIToUTF16(extension->id()))); | 406 GetAppBackgroundContents(ASCIIToUTF16(extension->id()))); |
407 // Now close the BackgroundContents. | 407 // Now close the BackgroundContents. |
408 ASSERT_TRUE(RunExtensionTest("app_background_page/basic_close")) << message_; | 408 ASSERT_TRUE(RunExtensionTest("app_background_page/basic_close")) << message_; |
409 // Background mode should no longer be active. | 409 // Background mode should no longer be active. |
410 ASSERT_TRUE(WaitForBackgroundMode(false)); | 410 ASSERT_TRUE(WaitForBackgroundMode(false)); |
411 ASSERT_FALSE( | 411 ASSERT_FALSE( |
412 BackgroundContentsServiceFactory::GetForProfile(browser()->profile())-> | 412 BackgroundContentsServiceFactory::GetForProfile(browser()->profile())-> |
413 GetAppBackgroundContents(ASCIIToUTF16(extension->id()))); | 413 GetAppBackgroundContents(ASCIIToUTF16(extension->id()))); |
414 } | 414 } |
OLD | NEW |