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 <stddef.h> | 5 #include <stddef.h> |
6 #include <utility> | 6 #include <utility> |
7 | 7 |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 chrome::GoBack(browser(), CURRENT_TAB); | 192 chrome::GoBack(browser(), CURRENT_TAB); |
193 EXPECT_FALSE(chrome::CanGoBack(browser())); | 193 EXPECT_FALSE(chrome::CanGoBack(browser())); |
194 } | 194 } |
195 | 195 |
196 // Tests that cookies set within an isolated app are not visible to normal | 196 // Tests that cookies set within an isolated app are not visible to normal |
197 // pages or other apps. | 197 // pages or other apps. |
198 // | 198 // |
199 // TODO(ajwong): Also test what happens if an app spans multiple sites in its | 199 // TODO(ajwong): Also test what happens if an app spans multiple sites in its |
200 // extent. These origins should also be isolated, but still have origin-based | 200 // extent. These origins should also be isolated, but still have origin-based |
201 // separation as you would expect. | 201 // separation as you would expect. |
202 // | 202 IN_PROC_BROWSER_TEST_F(IsolatedAppTest, CookieIsolation) { |
203 // This test is disabled due to being flaky. http://crbug.com/86562 | |
204 #if defined(OS_WIN) | |
205 #define MAYBE_CookieIsolation DISABLED_CookieIsolation | |
206 #else | |
207 #define MAYBE_CookieIsolation CookieIsolation | |
208 #endif | |
209 IN_PROC_BROWSER_TEST_F(IsolatedAppTest, MAYBE_CookieIsolation) { | |
210 host_resolver()->AddRule("*", "127.0.0.1"); | 203 host_resolver()->AddRule("*", "127.0.0.1"); |
211 ASSERT_TRUE(embedded_test_server()->Start()); | 204 ASSERT_TRUE(embedded_test_server()->Start()); |
212 | 205 |
213 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("isolated_apps/app1"))); | 206 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("isolated_apps/app1"))); |
214 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("isolated_apps/app2"))); | 207 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("isolated_apps/app2"))); |
215 | 208 |
216 // The app under test acts on URLs whose host is "localhost", | 209 // The app under test acts on URLs whose host is "localhost", |
217 // so the URLs we navigate to must have host "localhost". | 210 // so the URLs we navigate to must have host "localhost". |
218 GURL base_url = embedded_test_server()->GetURL("/extensions/isolated_apps/"); | 211 GURL base_url = embedded_test_server()->GetURL("/extensions/isolated_apps/"); |
219 GURL::Replacements replace_host; | 212 GURL::Replacements replace_host; |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 browser(), base_url.Resolve("non_app/main.html")); | 556 browser(), base_url.Resolve("non_app/main.html")); |
564 ASSERT_TRUE(ExecuteScriptAndExtractString( | 557 ASSERT_TRUE(ExecuteScriptAndExtractString( |
565 browser()->tab_strip_model()->GetWebContentsAt(0), | 558 browser()->tab_strip_model()->GetWebContentsAt(0), |
566 kRetrieveSessionStorage.c_str(), &result)); | 559 kRetrieveSessionStorage.c_str(), &result)); |
567 EXPECT_EQ("ss_normal", result); | 560 EXPECT_EQ("ss_normal", result); |
568 } | 561 } |
569 | 562 |
570 } // namespace | 563 } // namespace |
571 | 564 |
572 } // namespace extensions | 565 } // namespace extensions |
OLD | NEW |