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/strings/stringprintf.h" | 5 #include "base/strings/stringprintf.h" |
6 #include "base/strings/utf_string_conversions.h" | 6 #include "base/strings/utf_string_conversions.h" |
7 #include "chrome/browser/automation/automation_util.h" | 7 #include "chrome/browser/automation/automation_util.h" |
8 #include "chrome/browser/extensions/extension_apitest.h" | 8 #include "chrome/browser/extensions/extension_apitest.h" |
9 #include "chrome/browser/extensions/extension_host.h" | 9 #include "chrome/browser/extensions/extension_host.h" |
10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 chrome::GoBack(browser(), CURRENT_TAB); | 196 chrome::GoBack(browser(), CURRENT_TAB); |
197 EXPECT_FALSE(chrome::CanGoBack(browser())); | 197 EXPECT_FALSE(chrome::CanGoBack(browser())); |
198 } | 198 } |
199 | 199 |
200 // Tests that cookies set within an isolated app are not visible to normal | 200 // Tests that cookies set within an isolated app are not visible to normal |
201 // pages or other apps. | 201 // pages or other apps. |
202 // | 202 // |
203 // TODO(ajwong): Also test what happens if an app spans multiple sites in its | 203 // TODO(ajwong): Also test what happens if an app spans multiple sites in its |
204 // extent. These origins should also be isolated, but still have origin-based | 204 // extent. These origins should also be isolated, but still have origin-based |
205 // separation as you would expect. | 205 // separation as you would expect. |
206 IN_PROC_BROWSER_TEST_F(IsolatedAppTest, CookieIsolation) { | 206 // |
| 207 // This test is disabled due to being flaky. http://crbug.com/86562 |
| 208 #if defined(OS_WIN) |
| 209 #define MAYBE_CookieIsolation DISABLED_CookieIsolation |
| 210 #else |
| 211 #define MAYBE_CookieIsolation CookieIsolation |
| 212 #endif |
| 213 IN_PROC_BROWSER_TEST_F(IsolatedAppTest, MAYBE_CookieIsolation) { |
207 host_resolver()->AddRule("*", "127.0.0.1"); | 214 host_resolver()->AddRule("*", "127.0.0.1"); |
208 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 215 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
209 | 216 |
210 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("isolated_apps/app1"))); | 217 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("isolated_apps/app1"))); |
211 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("isolated_apps/app2"))); | 218 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("isolated_apps/app2"))); |
212 | 219 |
213 // The app under test acts on URLs whose host is "localhost", | 220 // The app under test acts on URLs whose host is "localhost", |
214 // so the URLs we navigate to must have host "localhost". | 221 // so the URLs we navigate to must have host "localhost". |
215 GURL base_url = embedded_test_server()->GetURL("/extensions/isolated_apps/"); | 222 GURL base_url = embedded_test_server()->GetURL("/extensions/isolated_apps/"); |
216 GURL::Replacements replace_host; | 223 GURL::Replacements replace_host; |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 EXPECT_EQ("ss_app2", result); | 588 EXPECT_EQ("ss_app2", result); |
582 | 589 |
583 ui_test_utils::NavigateToURLWithDisposition( | 590 ui_test_utils::NavigateToURLWithDisposition( |
584 browser(), base_url.Resolve("non_app/main.html"), | 591 browser(), base_url.Resolve("non_app/main.html"), |
585 CURRENT_TAB, ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); | 592 CURRENT_TAB, ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); |
586 ASSERT_TRUE(ExecuteScriptAndExtractString( | 593 ASSERT_TRUE(ExecuteScriptAndExtractString( |
587 browser()->tab_strip_model()->GetWebContentsAt(0), | 594 browser()->tab_strip_model()->GetWebContentsAt(0), |
588 kRetrieveSessionStorage.c_str(), &result)); | 595 kRetrieveSessionStorage.c_str(), &result)); |
589 EXPECT_EQ("ss_normal", result); | 596 EXPECT_EQ("ss_normal", result); |
590 } | 597 } |
OLD | NEW |