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 "chrome/browser/extensions/extension_apitest.h" | 5 #include "chrome/browser/extensions/extension_apitest.h" |
6 #include "chrome/browser/extensions/extension_host.h" | 6 #include "chrome/browser/extensions/extension_host.h" |
7 #include "chrome/browser/extensions/extension_service.h" | 7 #include "chrome/browser/extensions/extension_service.h" |
8 #include "chrome/browser/extensions/extension_system.h" | 8 #include "chrome/browser/extensions/extension_system.h" |
9 #include "chrome/browser/extensions/process_map.h" | 9 #include "chrome/browser/extensions/process_map.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 extensions::ProcessMap* process_map = service->process_map(); | 280 extensions::ProcessMap* process_map = service->process_map(); |
281 | 281 |
282 host_resolver()->AddRule("*", "127.0.0.1"); | 282 host_resolver()->AddRule("*", "127.0.0.1"); |
283 ASSERT_TRUE(test_server()->Start()); | 283 ASSERT_TRUE(test_server()->Start()); |
284 GURL base_url = GetTestBaseURL("app_process"); | 284 GURL base_url = GetTestBaseURL("app_process"); |
285 | 285 |
286 // Load an app as a bookmark app. | 286 // Load an app as a bookmark app. |
287 std::string error; | 287 std::string error; |
288 scoped_refptr<const Extension> extension(extension_file_util::LoadExtension( | 288 scoped_refptr<const Extension> extension(extension_file_util::LoadExtension( |
289 test_data_dir_.AppendASCII("app_process"), | 289 test_data_dir_.AppendASCII("app_process"), |
290 Extension::LOAD, | 290 extensions::Manifest::LOAD, |
291 Extension::FROM_BOOKMARK, | 291 Extension::FROM_BOOKMARK, |
292 &error)); | 292 &error)); |
293 service->OnExtensionInstalled(extension, | 293 service->OnExtensionInstalled(extension, |
294 syncer::StringOrdinal::CreateInitialOrdinal(), | 294 syncer::StringOrdinal::CreateInitialOrdinal(), |
295 false /* no requirement errors */, | 295 false /* no requirement errors */, |
296 false /* don't wait for idle */); | 296 false /* don't wait for idle */); |
297 ASSERT_TRUE(extension.get()); | 297 ASSERT_TRUE(extension.get()); |
298 ASSERT_TRUE(extension->from_bookmark()); | 298 ASSERT_TRUE(extension->from_bookmark()); |
299 | 299 |
300 // Test both opening a URL in a new tab, and opening a tab and then navigating | 300 // Test both opening a URL in a new tab, and opening a tab and then navigating |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
669 &browser()->tab_strip_model()->GetActiveWebContents()-> | 669 &browser()->tab_strip_model()->GetActiveWebContents()-> |
670 GetController())); | 670 GetController())); |
671 chrome::Reload(browser(), CURRENT_TAB); | 671 chrome::Reload(browser(), CURRENT_TAB); |
672 observer.Wait(); | 672 observer.Wait(); |
673 ASSERT_TRUE(content::ExecuteScriptAndExtractBool( | 673 ASSERT_TRUE(content::ExecuteScriptAndExtractBool( |
674 contents, | 674 contents, |
675 "window.domAutomationController.send(chrome.app.isInstalled)", | 675 "window.domAutomationController.send(chrome.app.isInstalled)", |
676 &is_installed)); | 676 &is_installed)); |
677 ASSERT_TRUE(is_installed); | 677 ASSERT_TRUE(is_installed); |
678 } | 678 } |
OLD | NEW |