OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "apps/launcher.h" | 5 #include "apps/launcher.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 } | 404 } |
405 | 405 |
406 // Tests that platform apps have isolated storage by default. | 406 // Tests that platform apps have isolated storage by default. |
407 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, Isolation) { | 407 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, Isolation) { |
408 ASSERT_TRUE(StartEmbeddedTestServer()); | 408 ASSERT_TRUE(StartEmbeddedTestServer()); |
409 | 409 |
410 // Load a (non-app) page under the "localhost" origin that sets a cookie. | 410 // Load a (non-app) page under the "localhost" origin that sets a cookie. |
411 GURL set_cookie_url = embedded_test_server()->GetURL( | 411 GURL set_cookie_url = embedded_test_server()->GetURL( |
412 "/extensions/platform_apps/isolation/set_cookie.html"); | 412 "/extensions/platform_apps/isolation/set_cookie.html"); |
413 GURL::Replacements replace_host; | 413 GURL::Replacements replace_host; |
414 std::string host_str("localhost"); // Must stay in scope with replace_host. | 414 replace_host.SetHostStr("localhost"); |
415 replace_host.SetHostStr(host_str); | |
416 set_cookie_url = set_cookie_url.ReplaceComponents(replace_host); | 415 set_cookie_url = set_cookie_url.ReplaceComponents(replace_host); |
417 | 416 |
418 ui_test_utils::NavigateToURL(browser(), set_cookie_url); | 417 ui_test_utils::NavigateToURL(browser(), set_cookie_url); |
419 | 418 |
420 // Make sure the cookie is set. | 419 // Make sure the cookie is set. |
421 int cookie_size; | 420 int cookie_size; |
422 std::string cookie_value; | 421 std::string cookie_value; |
423 ui_test_utils::GetCookies( | 422 ui_test_utils::GetCookies( |
424 set_cookie_url, | 423 set_cookie_url, |
425 browser()->tab_strip_model()->GetWebContentsAt(0), | 424 browser()->tab_strip_model()->GetWebContentsAt(0), |
(...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1334 // Now check that the app window's default zoom, and actual zoom level, | 1333 // Now check that the app window's default zoom, and actual zoom level, |
1335 // have not been changed from the default. | 1334 // have not been changed from the default. |
1336 WebContents* web_contents = GetFirstAppWindowWebContents(); | 1335 WebContents* web_contents = GetFirstAppWindowWebContents(); |
1337 content::HostZoomMap* app_host_zoom_map = content::HostZoomMap::Get( | 1336 content::HostZoomMap* app_host_zoom_map = content::HostZoomMap::Get( |
1338 web_contents->GetSiteInstance()); | 1337 web_contents->GetSiteInstance()); |
1339 EXPECT_EQ(0, app_host_zoom_map->GetDefaultZoomLevel()); | 1338 EXPECT_EQ(0, app_host_zoom_map->GetDefaultZoomLevel()); |
1340 EXPECT_EQ(0, app_host_zoom_map->GetZoomLevel(web_contents)); | 1339 EXPECT_EQ(0, app_host_zoom_map->GetZoomLevel(web_contents)); |
1341 } | 1340 } |
1342 | 1341 |
1343 } // namespace extensions | 1342 } // namespace extensions |
OLD | NEW |