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 "base/path_service.h" | 5 #include "base/path_service.h" |
6 #include "base/strings/stringprintf.h" | 6 #include "base/strings/stringprintf.h" |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "chrome/browser/apps/app_browsertest_util.h" | 8 #include "chrome/browser/apps/app_browsertest_util.h" |
9 #include "chrome/browser/chrome_content_browser_client.h" | 9 #include "chrome/browser/chrome_content_browser_client.h" |
10 #include "chrome/browser/prerender/prerender_link_manager.h" | 10 #include "chrome/browser/prerender/prerender_link_manager.h" |
(...skipping 1306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1317 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyWebView())); | 1317 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyWebView())); |
1318 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyTab())); | 1318 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyTab())); |
1319 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyApp())); | 1319 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyApp())); |
1320 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyBackground())); | 1320 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows(1, MatchAnyBackground())); |
1321 } | 1321 } |
1322 | 1322 |
1323 // This tests cookie isolation for packaged apps with webview tags. It navigates | 1323 // This tests cookie isolation for packaged apps with webview tags. It navigates |
1324 // the main browser window to a page that sets a cookie and loads an app with | 1324 // the main browser window to a page that sets a cookie and loads an app with |
1325 // multiple webview tags. Each tag sets a cookie and the test checks the proper | 1325 // multiple webview tags. Each tag sets a cookie and the test checks the proper |
1326 // storage isolation is enforced. | 1326 // storage isolation is enforced. |
1327 IN_PROC_BROWSER_TEST_F(WebViewTest, CookieIsolation) { | 1327 // This test is flaky. See http://crbug.com/294196. |
| 1328 IN_PROC_BROWSER_TEST_F(WebViewTest, DISABLED_CookieIsolation) { |
1328 ASSERT_TRUE(StartEmbeddedTestServer()); | 1329 ASSERT_TRUE(StartEmbeddedTestServer()); |
1329 const std::string kExpire = | 1330 const std::string kExpire = |
1330 "var expire = new Date(Date.now() + 24 * 60 * 60 * 1000);"; | 1331 "var expire = new Date(Date.now() + 24 * 60 * 60 * 1000);"; |
1331 std::string cookie_script1(kExpire); | 1332 std::string cookie_script1(kExpire); |
1332 cookie_script1.append( | 1333 cookie_script1.append( |
1333 "document.cookie = 'guest1=true; path=/; expires=' + expire + ';';"); | 1334 "document.cookie = 'guest1=true; path=/; expires=' + expire + ';';"); |
1334 std::string cookie_script2(kExpire); | 1335 std::string cookie_script2(kExpire); |
1335 cookie_script2.append( | 1336 cookie_script2.append( |
1336 "document.cookie = 'guest2=true; path=/; expires=' + expire + ';';"); | 1337 "document.cookie = 'guest2=true; path=/; expires=' + expire + ';';"); |
1337 | 1338 |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1624 EXPECT_STREQ("badval", output.c_str()); | 1625 EXPECT_STREQ("badval", output.c_str()); |
1625 EXPECT_TRUE(ExecuteScriptAndExtractString(default_tag_contents1, | 1626 EXPECT_TRUE(ExecuteScriptAndExtractString(default_tag_contents1, |
1626 get_session_storage.c_str(), | 1627 get_session_storage.c_str(), |
1627 &output)); | 1628 &output)); |
1628 EXPECT_STREQ("badval", output.c_str()); | 1629 EXPECT_STREQ("badval", output.c_str()); |
1629 } | 1630 } |
1630 | 1631 |
1631 // This tests IndexedDB isolation for packaged apps with webview tags. It loads | 1632 // This tests IndexedDB isolation for packaged apps with webview tags. It loads |
1632 // an app with multiple webview tags and each tag creates an IndexedDB record, | 1633 // an app with multiple webview tags and each tag creates an IndexedDB record, |
1633 // which the test checks to ensure proper storage isolation is enforced. | 1634 // which the test checks to ensure proper storage isolation is enforced. |
1634 IN_PROC_BROWSER_TEST_F(WebViewTest, IndexedDBIsolation) { | 1635 // This test is flaky. See http://crbug.com/248500. |
| 1636 IN_PROC_BROWSER_TEST_F(WebViewTest, DISABLED_IndexedDBIsolation) { |
1635 ASSERT_TRUE(StartEmbeddedTestServer()); | 1637 ASSERT_TRUE(StartEmbeddedTestServer()); |
1636 GURL regular_url = embedded_test_server()->GetURL("/title1.html"); | 1638 GURL regular_url = embedded_test_server()->GetURL("/title1.html"); |
1637 | 1639 |
1638 content::WebContents* default_tag_contents1; | 1640 content::WebContents* default_tag_contents1; |
1639 content::WebContents* default_tag_contents2; | 1641 content::WebContents* default_tag_contents2; |
1640 content::WebContents* storage_contents1; | 1642 content::WebContents* storage_contents1; |
1641 content::WebContents* storage_contents2; | 1643 content::WebContents* storage_contents2; |
1642 | 1644 |
1643 NavigateAndOpenAppForIsolation(regular_url, &default_tag_contents1, | 1645 NavigateAndOpenAppForIsolation(regular_url, &default_tag_contents1, |
1644 &default_tag_contents2, &storage_contents1, | 1646 &default_tag_contents2, &storage_contents1, |
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2297 // http://crbug.com/403325 | 2299 // http://crbug.com/403325 |
2298 #define MAYBE_WebViewInBackgroundPage \ | 2300 #define MAYBE_WebViewInBackgroundPage \ |
2299 DISABLED_WebViewInBackgroundPage | 2301 DISABLED_WebViewInBackgroundPage |
2300 #else | 2302 #else |
2301 #define MAYBE_WebViewInBackgroundPage WebViewInBackgroundPage | 2303 #define MAYBE_WebViewInBackgroundPage WebViewInBackgroundPage |
2302 #endif | 2304 #endif |
2303 IN_PROC_BROWSER_TEST_F(WebViewTest, MAYBE_WebViewInBackgroundPage) { | 2305 IN_PROC_BROWSER_TEST_F(WebViewTest, MAYBE_WebViewInBackgroundPage) { |
2304 ASSERT_TRUE(RunExtensionTest("platform_apps/web_view/background")) | 2306 ASSERT_TRUE(RunExtensionTest("platform_apps/web_view/background")) |
2305 << message_; | 2307 << message_; |
2306 } | 2308 } |
OLD | NEW |