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_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" | 10 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 std::string error; | 305 std::string error; |
306 scoped_refptr<const Extension> extension(extensions::file_util::LoadExtension( | 306 scoped_refptr<const Extension> extension(extensions::file_util::LoadExtension( |
307 test_data_dir_.AppendASCII("app_process"), | 307 test_data_dir_.AppendASCII("app_process"), |
308 extensions::Manifest::UNPACKED, | 308 extensions::Manifest::UNPACKED, |
309 Extension::FROM_BOOKMARK, | 309 Extension::FROM_BOOKMARK, |
310 &error)); | 310 &error)); |
311 service->OnExtensionInstalled(extension.get(), | 311 service->OnExtensionInstalled(extension.get(), |
312 syncer::StringOrdinal::CreateInitialOrdinal(), | 312 syncer::StringOrdinal::CreateInitialOrdinal(), |
313 false /* no requirement errors */, | 313 false /* no requirement errors */, |
314 extensions::NOT_BLACKLISTED, | 314 extensions::NOT_BLACKLISTED, |
| 315 false /* not ephemeral */, |
315 false /* don't wait for idle */); | 316 false /* don't wait for idle */); |
316 ASSERT_TRUE(extension.get()); | 317 ASSERT_TRUE(extension.get()); |
317 ASSERT_TRUE(extension->from_bookmark()); | 318 ASSERT_TRUE(extension->from_bookmark()); |
318 | 319 |
319 // Test both opening a URL in a new tab, and opening a tab and then navigating | 320 // Test both opening a URL in a new tab, and opening a tab and then navigating |
320 // it. Either way, bookmark app tabs should be considered normal processes | 321 // it. Either way, bookmark app tabs should be considered normal processes |
321 // with no elevated privileges and no WebUI bindings. | 322 // with no elevated privileges and no WebUI bindings. |
322 ui_test_utils::NavigateToURLWithDisposition( | 323 ui_test_utils::NavigateToURLWithDisposition( |
323 browser(), base_url.Resolve("path1/empty.html"), NEW_FOREGROUND_TAB, | 324 browser(), base_url.Resolve("path1/empty.html"), NEW_FOREGROUND_TAB, |
324 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); | 325 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); |
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
872 // Navigate the popup to another process outside the app. | 873 // Navigate the popup to another process outside the app. |
873 GURL non_app_url(base_url.Resolve("path3/empty.html")); | 874 GURL non_app_url(base_url.Resolve("path3/empty.html")); |
874 ui_test_utils::NavigateToURL(active_browser_list->get(1), non_app_url); | 875 ui_test_utils::NavigateToURL(active_browser_list->get(1), non_app_url); |
875 SiteInstance* new_instance = popup_contents->GetSiteInstance(); | 876 SiteInstance* new_instance = popup_contents->GetSiteInstance(); |
876 EXPECT_NE(app_instance, new_instance); | 877 EXPECT_NE(app_instance, new_instance); |
877 | 878 |
878 // It should still be in the same BrowsingInstance, allowing postMessage to | 879 // It should still be in the same BrowsingInstance, allowing postMessage to |
879 // work. | 880 // work. |
880 EXPECT_TRUE(app_instance->IsRelatedSiteInstance(new_instance)); | 881 EXPECT_TRUE(app_instance->IsRelatedSiteInstance(new_instance)); |
881 } | 882 } |
OLD | NEW |