| 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/utf_string_conversions.h" | 5 #include "base/utf_string_conversions.h" |
| 6 #include "chrome/browser/automation/automation_util.h" | 6 #include "chrome/browser/automation/automation_util.h" |
| 7 #include "chrome/browser/extensions/extension_apitest.h" | 7 #include "chrome/browser/extensions/extension_apitest.h" |
| 8 #include "chrome/browser/extensions/extension_host.h" | 8 #include "chrome/browser/extensions/extension_host.h" |
| 9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 content::Source<NavigationController>( | 167 content::Source<NavigationController>( |
| 168 &chrome::GetActiveWebContents(browser())->GetController())); | 168 &chrome::GetActiveWebContents(browser())->GetController())); |
| 169 chrome::Reload(browser(), CURRENT_TAB); | 169 chrome::Reload(browser(), CURRENT_TAB); |
| 170 observer.Wait(); | 170 observer.Wait(); |
| 171 EXPECT_TRUE(HasCookie(tab0, "app1=3")); | 171 EXPECT_TRUE(HasCookie(tab0, "app1=3")); |
| 172 EXPECT_FALSE(HasCookie(tab0, "app2")); | 172 EXPECT_FALSE(HasCookie(tab0, "app2")); |
| 173 EXPECT_FALSE(HasCookie(tab0, "normalPage")); | 173 EXPECT_FALSE(HasCookie(tab0, "normalPage")); |
| 174 | 174 |
| 175 } | 175 } |
| 176 | 176 |
| 177 // This test is disabled due to being flaky. http://crbug.com/145588 |
| 177 // Ensure that cookies are not isolated if the isolated apps are not installed. | 178 // Ensure that cookies are not isolated if the isolated apps are not installed. |
| 178 IN_PROC_BROWSER_TEST_F(IsolatedAppTest, NoCookieIsolationWithoutApp) { | 179 IN_PROC_BROWSER_TEST_F(IsolatedAppTest, DISABLED_NoCookieIsolationWithoutApp) { |
| 179 host_resolver()->AddRule("*", "127.0.0.1"); | 180 host_resolver()->AddRule("*", "127.0.0.1"); |
| 180 ASSERT_TRUE(test_server()->Start()); | 181 ASSERT_TRUE(test_server()->Start()); |
| 181 | 182 |
| 182 // The app under test acts on URLs whose host is "localhost", | 183 // The app under test acts on URLs whose host is "localhost", |
| 183 // so the URLs we navigate to must have host "localhost". | 184 // so the URLs we navigate to must have host "localhost". |
| 184 GURL base_url = test_server()->GetURL("files/extensions/isolated_apps/"); | 185 GURL base_url = test_server()->GetURL("files/extensions/isolated_apps/"); |
| 185 GURL::Replacements replace_host; | 186 GURL::Replacements replace_host; |
| 186 std::string host_str("localhost"); // Must stay in scope with replace_host. | 187 std::string host_str("localhost"); // Must stay in scope with replace_host. |
| 187 replace_host.SetHostStr(host_str); | 188 replace_host.SetHostStr(host_str); |
| 188 base_url = base_url.ReplaceComponents(replace_host); | 189 base_url = base_url.ReplaceComponents(replace_host); |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 EXPECT_EQ("ss_app2", result); | 424 EXPECT_EQ("ss_app2", result); |
| 424 | 425 |
| 425 ui_test_utils::NavigateToURLWithDisposition( | 426 ui_test_utils::NavigateToURLWithDisposition( |
| 426 browser(), base_url.Resolve("non_app/main.html"), | 427 browser(), base_url.Resolve("non_app/main.html"), |
| 427 CURRENT_TAB, ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); | 428 CURRENT_TAB, ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); |
| 428 ASSERT_TRUE(ExecuteJavaScriptAndExtractString( | 429 ASSERT_TRUE(ExecuteJavaScriptAndExtractString( |
| 429 chrome::GetWebContentsAt(browser(), 0)->GetRenderViewHost(), | 430 chrome::GetWebContentsAt(browser(), 0)->GetRenderViewHost(), |
| 430 L"", kRetrieveSessionStorage.c_str(), &result)); | 431 L"", kRetrieveSessionStorage.c_str(), &result)); |
| 431 EXPECT_EQ("ss_normal", result); | 432 EXPECT_EQ("ss_normal", result); |
| 432 } | 433 } |
| OLD | NEW |