| 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/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
| 7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 #include "chrome/common/chrome_switches.h" | 35 #include "chrome/common/chrome_switches.h" |
| 36 #include "chrome/common/url_constants.h" | 36 #include "chrome/common/url_constants.h" |
| 37 #include "chrome/test/base/ui_test_utils.h" | 37 #include "chrome/test/base/ui_test_utils.h" |
| 38 #include "components/user_prefs/pref_registry_syncable.h" | 38 #include "components/user_prefs/pref_registry_syncable.h" |
| 39 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 39 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
| 40 #include "content/public/browser/devtools_agent_host.h" | 40 #include "content/public/browser/devtools_agent_host.h" |
| 41 #include "content/public/browser/render_process_host.h" | 41 #include "content/public/browser/render_process_host.h" |
| 42 #include "content/public/browser/render_widget_host_view.h" | 42 #include "content/public/browser/render_widget_host_view.h" |
| 43 #include "content/public/browser/web_contents_view.h" | 43 #include "content/public/browser/web_contents_view.h" |
| 44 #include "content/public/test/test_utils.h" | 44 #include "content/public/test/test_utils.h" |
| 45 #include "net/test/embedded_test_server/embedded_test_server.h" |
| 45 #include "googleurl/src/gurl.h" | 46 #include "googleurl/src/gurl.h" |
| 46 | 47 |
| 47 using content::WebContents; | 48 using content::WebContents; |
| 48 using web_modal::WebContentsModalDialogManager; | 49 using web_modal::WebContentsModalDialogManager; |
| 49 | 50 |
| 50 namespace extensions { | 51 namespace extensions { |
| 51 | 52 |
| 52 namespace { | 53 namespace { |
| 53 | 54 |
| 54 // Non-abstract RenderViewContextMenu class. | 55 // Non-abstract RenderViewContextMenu class. |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, PlatformAppsOnly) { | 339 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, PlatformAppsOnly) { |
| 339 ASSERT_TRUE(RunExtensionTestIgnoreManifestWarnings( | 340 ASSERT_TRUE(RunExtensionTestIgnoreManifestWarnings( |
| 340 "platform_apps/apps_only")) << message_; | 341 "platform_apps/apps_only")) << message_; |
| 341 } | 342 } |
| 342 | 343 |
| 343 // Tests that platform apps have isolated storage by default. | 344 // Tests that platform apps have isolated storage by default. |
| 344 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, Isolation) { | 345 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, Isolation) { |
| 345 ASSERT_TRUE(StartTestServer()); | 346 ASSERT_TRUE(StartTestServer()); |
| 346 | 347 |
| 347 // Load a (non-app) page under the "localhost" origin that sets a cookie. | 348 // Load a (non-app) page under the "localhost" origin that sets a cookie. |
| 348 GURL set_cookie_url = test_server()->GetURL( | 349 GURL set_cookie_url = embedded_test_server()->GetURL( |
| 349 "files/extensions/platform_apps/isolation/set_cookie.html"); | 350 "/extensions/platform_apps/isolation/set_cookie.html"); |
| 350 GURL::Replacements replace_host; | 351 GURL::Replacements replace_host; |
| 351 std::string host_str("localhost"); // Must stay in scope with replace_host. | 352 std::string host_str("localhost"); // Must stay in scope with replace_host. |
| 352 replace_host.SetHostStr(host_str); | 353 replace_host.SetHostStr(host_str); |
| 353 set_cookie_url = set_cookie_url.ReplaceComponents(replace_host); | 354 set_cookie_url = set_cookie_url.ReplaceComponents(replace_host); |
| 354 | 355 |
| 355 ui_test_utils::NavigateToURLWithDisposition( | 356 ui_test_utils::NavigateToURLWithDisposition( |
| 356 browser(), set_cookie_url, | 357 browser(), set_cookie_url, |
| 357 CURRENT_TAB, ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); | 358 CURRENT_TAB, ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); |
| 358 | 359 |
| 359 // Make sure the cookie is set. | 360 // Make sure the cookie is set. |
| (...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1000 | 1001 |
| 1001 while (!ContainsKey(opener_app_ids_, file_manager->id())) { | 1002 while (!ContainsKey(opener_app_ids_, file_manager->id())) { |
| 1002 content::RunAllPendingInMessageLoop(); | 1003 content::RunAllPendingInMessageLoop(); |
| 1003 } | 1004 } |
| 1004 } | 1005 } |
| 1005 | 1006 |
| 1006 #endif // defined(OS_CHROMEOS) | 1007 #endif // defined(OS_CHROMEOS) |
| 1007 | 1008 |
| 1008 | 1009 |
| 1009 } // namespace extensions | 1010 } // namespace extensions |
| OLD | NEW |