| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/string_util.h" | 5 #include "base/string_util.h" |
| 6 #include "chrome/browser/background_contents_service.h" | 6 #include "chrome/browser/background_contents_service.h" |
| 7 #include "chrome/browser/background_contents_service_factory.h" |
| 7 #include "chrome/browser/extensions/extension_apitest.h" | 8 #include "chrome/browser/extensions/extension_apitest.h" |
| 8 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/ui/browser.h" | 11 #include "chrome/browser/ui/browser.h" |
| 11 #include "chrome/common/chrome_switches.h" | 12 #include "chrome/common/chrome_switches.h" |
| 12 #include "chrome/common/extensions/extension.h" | 13 #include "chrome/common/extensions/extension.h" |
| 13 #include "chrome/test/ui_test_utils.h" | 14 #include "chrome/test/ui_test_utils.h" |
| 14 #include "net/base/mock_host_resolver.h" | 15 #include "net/base/mock_host_resolver.h" |
| 15 | 16 |
| 16 class AppBackgroundPageApiTest : public ExtensionApiTest { | 17 class AppBackgroundPageApiTest : public ExtensionApiTest { |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 " \"background_page\": \"http://a.com:%d/test.html\"" | 118 " \"background_page\": \"http://a.com:%d/test.html\"" |
| 118 "}", | 119 "}", |
| 119 test_server()->host_port_pair().port(), | 120 test_server()->host_port_pair().port(), |
| 120 test_server()->host_port_pair().port()); | 121 test_server()->host_port_pair().port()); |
| 121 | 122 |
| 122 FilePath app_dir; | 123 FilePath app_dir; |
| 123 ASSERT_TRUE(CreateApp(app_manifest, &app_dir)); | 124 ASSERT_TRUE(CreateApp(app_manifest, &app_dir)); |
| 124 ASSERT_TRUE(LoadExtension(app_dir)); | 125 ASSERT_TRUE(LoadExtension(app_dir)); |
| 125 | 126 |
| 126 const Extension* extension = GetSingleLoadedExtension(); | 127 const Extension* extension = GetSingleLoadedExtension(); |
| 127 ASSERT_TRUE(browser()->profile()->GetBackgroundContentsService()-> | 128 ASSERT_TRUE( |
| 128 GetAppBackgroundContents(ASCIIToUTF16(extension->id()))); | 129 BackgroundContentsServiceFactory::GetForProfile(browser()->profile())-> |
| 130 GetAppBackgroundContents(ASCIIToUTF16(extension->id()))); |
| 129 } | 131 } |
| OLD | NEW |