| 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "chrome/browser/chrome_notification_types.h" | 6 #include "chrome/browser/chrome_notification_types.h" |
| 7 #include "chrome/browser/extensions/extension_apitest.h" | 7 #include "chrome/browser/extensions/extension_apitest.h" |
| 8 #include "chrome/browser/extensions/extension_host.h" | 8 #include "chrome/browser/extensions/extension_host.h" |
| 9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
| 10 #include "chrome/browser/extensions/extension_system.h" | 10 #include "chrome/browser/extensions/extension_system.h" |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 // Load an app as a bookmark app. | 303 // Load an app as a bookmark app. |
| 304 std::string error; | 304 std::string error; |
| 305 scoped_refptr<const Extension> extension(extension_file_util::LoadExtension( | 305 scoped_refptr<const Extension> extension(extension_file_util::LoadExtension( |
| 306 test_data_dir_.AppendASCII("app_process"), | 306 test_data_dir_.AppendASCII("app_process"), |
| 307 extensions::Manifest::UNPACKED, | 307 extensions::Manifest::UNPACKED, |
| 308 Extension::FROM_BOOKMARK, | 308 Extension::FROM_BOOKMARK, |
| 309 &error)); | 309 &error)); |
| 310 service->OnExtensionInstalled(extension.get(), | 310 service->OnExtensionInstalled(extension.get(), |
| 311 syncer::StringOrdinal::CreateInitialOrdinal(), | 311 syncer::StringOrdinal::CreateInitialOrdinal(), |
| 312 false /* no requirement errors */, | 312 false /* no requirement errors */, |
| 313 extensions::Blacklist::NOT_BLACKLISTED, | 313 extensions::NOT_BLACKLISTED, |
| 314 false /* don't wait for idle */); | 314 false /* don't wait for idle */); |
| 315 ASSERT_TRUE(extension.get()); | 315 ASSERT_TRUE(extension.get()); |
| 316 ASSERT_TRUE(extension->from_bookmark()); | 316 ASSERT_TRUE(extension->from_bookmark()); |
| 317 | 317 |
| 318 // Test both opening a URL in a new tab, and opening a tab and then navigating | 318 // Test both opening a URL in a new tab, and opening a tab and then navigating |
| 319 // it. Either way, bookmark app tabs should be considered normal processes | 319 // it. Either way, bookmark app tabs should be considered normal processes |
| 320 // with no elevated privileges and no WebUI bindings. | 320 // with no elevated privileges and no WebUI bindings. |
| 321 ui_test_utils::NavigateToURLWithDisposition( | 321 ui_test_utils::NavigateToURLWithDisposition( |
| 322 browser(), base_url.Resolve("path1/empty.html"), NEW_FOREGROUND_TAB, | 322 browser(), base_url.Resolve("path1/empty.html"), NEW_FOREGROUND_TAB, |
| 323 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); | 323 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); |
| (...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 865 // Navigate the popup to another process outside the app. | 865 // Navigate the popup to another process outside the app. |
| 866 GURL non_app_url(base_url.Resolve("path3/empty.html")); | 866 GURL non_app_url(base_url.Resolve("path3/empty.html")); |
| 867 ui_test_utils::NavigateToURL(active_browser_list->get(1), non_app_url); | 867 ui_test_utils::NavigateToURL(active_browser_list->get(1), non_app_url); |
| 868 SiteInstance* new_instance = popup_contents->GetSiteInstance(); | 868 SiteInstance* new_instance = popup_contents->GetSiteInstance(); |
| 869 EXPECT_NE(app_instance, new_instance); | 869 EXPECT_NE(app_instance, new_instance); |
| 870 | 870 |
| 871 // It should still be in the same BrowsingInstance, allowing postMessage to | 871 // It should still be in the same BrowsingInstance, allowing postMessage to |
| 872 // work. | 872 // work. |
| 873 EXPECT_TRUE(app_instance->IsRelatedSiteInstance(new_instance)); | 873 EXPECT_TRUE(app_instance->IsRelatedSiteInstance(new_instance)); |
| 874 } | 874 } |
| OLD | NEW |