| 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/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 GURL base_url = GetTestBaseURL("app_process"); | 246 GURL base_url = GetTestBaseURL("app_process"); |
| 247 | 247 |
| 248 // Load an app as a bookmark app. | 248 // Load an app as a bookmark app. |
| 249 std::string error; | 249 std::string error; |
| 250 scoped_refptr<const Extension> extension(extension_file_util::LoadExtension( | 250 scoped_refptr<const Extension> extension(extension_file_util::LoadExtension( |
| 251 test_data_dir_.AppendASCII("app_process"), | 251 test_data_dir_.AppendASCII("app_process"), |
| 252 Extension::LOAD, | 252 Extension::LOAD, |
| 253 Extension::FROM_BOOKMARK, | 253 Extension::FROM_BOOKMARK, |
| 254 &error)); | 254 &error)); |
| 255 service->OnExtensionInstalled(extension, false, | 255 service->OnExtensionInstalled(extension, false, |
| 256 syncer::StringOrdinal::CreateInitialOrdinal()); | 256 syncer::StringOrdinal::CreateInitialOrdinal(), |
| 257 false /* no requirement errors */); |
| 257 ASSERT_TRUE(extension.get()); | 258 ASSERT_TRUE(extension.get()); |
| 258 ASSERT_TRUE(extension->from_bookmark()); | 259 ASSERT_TRUE(extension->from_bookmark()); |
| 259 | 260 |
| 260 // Test both opening a URL in a new tab, and opening a tab and then navigating | 261 // Test both opening a URL in a new tab, and opening a tab and then navigating |
| 261 // it. Either way, bookmark app tabs should be considered normal processes | 262 // it. Either way, bookmark app tabs should be considered normal processes |
| 262 // with no elevated privileges and no WebUI bindings. | 263 // with no elevated privileges and no WebUI bindings. |
| 263 ui_test_utils::NavigateToURLWithDisposition( | 264 ui_test_utils::NavigateToURLWithDisposition( |
| 264 browser(), base_url.Resolve("path1/empty.html"), NEW_FOREGROUND_TAB, | 265 browser(), base_url.Resolve("path1/empty.html"), NEW_FOREGROUND_TAB, |
| 265 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); | 266 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); |
| 266 EXPECT_FALSE(process_map->Contains( | 267 EXPECT_FALSE(process_map->Contains( |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 583 content::Source<NavigationController>( | 584 content::Source<NavigationController>( |
| 584 &chrome::GetActiveWebContents(browser())->GetController())); | 585 &chrome::GetActiveWebContents(browser())->GetController())); |
| 585 chrome::Reload(browser(), CURRENT_TAB); | 586 chrome::Reload(browser(), CURRENT_TAB); |
| 586 observer.Wait(); | 587 observer.Wait(); |
| 587 ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool( | 588 ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool( |
| 588 contents->GetRenderViewHost(), L"", | 589 contents->GetRenderViewHost(), L"", |
| 589 L"window.domAutomationController.send(chrome.app.isInstalled)", | 590 L"window.domAutomationController.send(chrome.app.isInstalled)", |
| 590 &is_installed)); | 591 &is_installed)); |
| 591 ASSERT_TRUE(is_installed); | 592 ASSERT_TRUE(is_installed); |
| 592 } | 593 } |
| OLD | NEW |