| 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/process_map.h" | 8 #include "chrome/browser/extensions/process_map.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" | 10 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 ASSERT_TRUE(test_server()->Start()); | 256 ASSERT_TRUE(test_server()->Start()); |
| 257 GURL base_url = GetTestBaseURL("app_process"); | 257 GURL base_url = GetTestBaseURL("app_process"); |
| 258 | 258 |
| 259 // Load an app as a bookmark app. | 259 // Load an app as a bookmark app. |
| 260 std::string error; | 260 std::string error; |
| 261 scoped_refptr<const Extension> extension(extension_file_util::LoadExtension( | 261 scoped_refptr<const Extension> extension(extension_file_util::LoadExtension( |
| 262 test_data_dir_.AppendASCII("app_process"), | 262 test_data_dir_.AppendASCII("app_process"), |
| 263 Extension::LOAD, | 263 Extension::LOAD, |
| 264 Extension::FROM_BOOKMARK, | 264 Extension::FROM_BOOKMARK, |
| 265 &error)); | 265 &error)); |
| 266 service->OnExtensionInstalled(extension, false, | 266 service->OnExtensionInstalled(extension, |
| 267 syncer::StringOrdinal::CreateInitialOrdinal(), | 267 syncer::StringOrdinal::CreateInitialOrdinal(), |
| 268 false /* no requirement errors */); | 268 false /* no requirement errors */); |
| 269 ASSERT_TRUE(extension.get()); | 269 ASSERT_TRUE(extension.get()); |
| 270 ASSERT_TRUE(extension->from_bookmark()); | 270 ASSERT_TRUE(extension->from_bookmark()); |
| 271 | 271 |
| 272 // Test both opening a URL in a new tab, and opening a tab and then navigating | 272 // Test both opening a URL in a new tab, and opening a tab and then navigating |
| 273 // it. Either way, bookmark app tabs should be considered normal processes | 273 // it. Either way, bookmark app tabs should be considered normal processes |
| 274 // with no elevated privileges and no WebUI bindings. | 274 // with no elevated privileges and no WebUI bindings. |
| 275 ui_test_utils::NavigateToURLWithDisposition( | 275 ui_test_utils::NavigateToURLWithDisposition( |
| 276 browser(), base_url.Resolve("path1/empty.html"), NEW_FOREGROUND_TAB, | 276 browser(), base_url.Resolve("path1/empty.html"), NEW_FOREGROUND_TAB, |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 628 content::Source<NavigationController>( | 628 content::Source<NavigationController>( |
| 629 &chrome::GetActiveWebContents(browser())->GetController())); | 629 &chrome::GetActiveWebContents(browser())->GetController())); |
| 630 chrome::Reload(browser(), CURRENT_TAB); | 630 chrome::Reload(browser(), CURRENT_TAB); |
| 631 observer.Wait(); | 631 observer.Wait(); |
| 632 ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool( | 632 ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool( |
| 633 contents->GetRenderViewHost(), L"", | 633 contents->GetRenderViewHost(), L"", |
| 634 L"window.domAutomationController.send(chrome.app.isInstalled)", | 634 L"window.domAutomationController.send(chrome.app.isInstalled)", |
| 635 &is_installed)); | 635 &is_installed)); |
| 636 ASSERT_TRUE(is_installed); | 636 ASSERT_TRUE(is_installed); |
| 637 } | 637 } |
| OLD | NEW |