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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 ASSERT_TRUE(test_server()->Start()); | 293 ASSERT_TRUE(test_server()->Start()); |
294 GURL base_url = GetTestBaseURL("app_process"); | 294 GURL base_url = GetTestBaseURL("app_process"); |
295 | 295 |
296 // Load an app as a bookmark app. | 296 // Load an app as a bookmark app. |
297 std::string error; | 297 std::string error; |
298 scoped_refptr<const Extension> extension(extension_file_util::LoadExtension( | 298 scoped_refptr<const Extension> extension(extension_file_util::LoadExtension( |
299 test_data_dir_.AppendASCII("app_process"), | 299 test_data_dir_.AppendASCII("app_process"), |
300 extensions::Manifest::UNPACKED, | 300 extensions::Manifest::UNPACKED, |
301 Extension::FROM_BOOKMARK, | 301 Extension::FROM_BOOKMARK, |
302 &error)); | 302 &error)); |
303 service->OnExtensionInstalled(extension, | 303 service->OnExtensionInstalled(extension.get(), |
304 syncer::StringOrdinal::CreateInitialOrdinal(), | 304 syncer::StringOrdinal::CreateInitialOrdinal(), |
305 false /* no requirement errors */, | 305 false /* no requirement errors */, |
306 false /* don't wait for idle */); | 306 false /* don't wait for idle */); |
307 ASSERT_TRUE(extension.get()); | 307 ASSERT_TRUE(extension.get()); |
308 ASSERT_TRUE(extension->from_bookmark()); | 308 ASSERT_TRUE(extension->from_bookmark()); |
309 | 309 |
310 // Test both opening a URL in a new tab, and opening a tab and then navigating | 310 // Test both opening a URL in a new tab, and opening a tab and then navigating |
311 // it. Either way, bookmark app tabs should be considered normal processes | 311 // it. Either way, bookmark app tabs should be considered normal processes |
312 // with no elevated privileges and no WebUI bindings. | 312 // with no elevated privileges and no WebUI bindings. |
313 ui_test_utils::NavigateToURLWithDisposition( | 313 ui_test_utils::NavigateToURLWithDisposition( |
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
817 &browser()->tab_strip_model()->GetActiveWebContents()-> | 817 &browser()->tab_strip_model()->GetActiveWebContents()-> |
818 GetController())); | 818 GetController())); |
819 chrome::Reload(browser(), CURRENT_TAB); | 819 chrome::Reload(browser(), CURRENT_TAB); |
820 observer.Wait(); | 820 observer.Wait(); |
821 ASSERT_TRUE(content::ExecuteScriptAndExtractBool( | 821 ASSERT_TRUE(content::ExecuteScriptAndExtractBool( |
822 contents, | 822 contents, |
823 "window.domAutomationController.send(chrome.app.isInstalled)", | 823 "window.domAutomationController.send(chrome.app.isInstalled)", |
824 &is_installed)); | 824 &is_installed)); |
825 ASSERT_TRUE(is_installed); | 825 ASSERT_TRUE(is_installed); |
826 } | 826 } |
OLD | NEW |