| 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 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 EXPECT_NE(process_id_0, | 360 EXPECT_NE(process_id_0, |
| 361 chrome::GetWebContentsAt(browser(), 3)->GetRenderProcessHost()->GetI
D()); | 361 chrome::GetWebContentsAt(browser(), 3)->GetRenderProcessHost()->GetI
D()); |
| 362 | 362 |
| 363 // Navigating the second tab out of the app should cause a process swap. | 363 // Navigating the second tab out of the app should cause a process swap. |
| 364 const GURL& non_app_url(base_url.Resolve("non_app/main.html")); | 364 const GURL& non_app_url(base_url.Resolve("non_app/main.html")); |
| 365 NavigateInRenderer(chrome::GetWebContentsAt(browser(), 1), non_app_url); | 365 NavigateInRenderer(chrome::GetWebContentsAt(browser(), 1), non_app_url); |
| 366 EXPECT_NE(process_id_1, | 366 EXPECT_NE(process_id_1, |
| 367 chrome::GetWebContentsAt(browser(), 1)->GetRenderProcessHost()->GetI
D()); | 367 chrome::GetWebContentsAt(browser(), 1)->GetRenderProcessHost()->GetI
D()); |
| 368 } | 368 } |
| 369 | 369 |
| 370 IN_PROC_BROWSER_TEST_F(IsolatedAppTest, SessionStorage) { | 370 // This test no longer passes, since we don't properly isolate sessionStorage |
| 371 // for isolated apps. This was broken as part of the changes for storage |
| 372 // partition support for webview tags. |
| 373 // TODO(nasko): If isolated apps is no longer developed, this test should be |
| 374 // removed. http://crbug.com/159932 |
| 375 IN_PROC_BROWSER_TEST_F(IsolatedAppTest, DISABLED_SessionStorage) { |
| 371 host_resolver()->AddRule("*", "127.0.0.1"); | 376 host_resolver()->AddRule("*", "127.0.0.1"); |
| 372 ASSERT_TRUE(test_server()->Start()); | 377 ASSERT_TRUE(test_server()->Start()); |
| 373 | 378 |
| 374 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("isolated_apps/app1"))); | 379 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("isolated_apps/app1"))); |
| 375 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("isolated_apps/app2"))); | 380 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("isolated_apps/app2"))); |
| 376 | 381 |
| 377 // The app under test acts on URLs whose host is "localhost", | 382 // The app under test acts on URLs whose host is "localhost", |
| 378 // so the URLs we navigate to must have host "localhost". | 383 // so the URLs we navigate to must have host "localhost". |
| 379 GURL base_url = test_server()->GetURL("files/extensions/isolated_apps/"); | 384 GURL base_url = test_server()->GetURL("files/extensions/isolated_apps/"); |
| 380 GURL::Replacements replace_host; | 385 GURL::Replacements replace_host; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 EXPECT_EQ("ss_app2", result); | 436 EXPECT_EQ("ss_app2", result); |
| 432 | 437 |
| 433 ui_test_utils::NavigateToURLWithDisposition( | 438 ui_test_utils::NavigateToURLWithDisposition( |
| 434 browser(), base_url.Resolve("non_app/main.html"), | 439 browser(), base_url.Resolve("non_app/main.html"), |
| 435 CURRENT_TAB, ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); | 440 CURRENT_TAB, ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); |
| 436 ASSERT_TRUE(ExecuteJavaScriptAndExtractString( | 441 ASSERT_TRUE(ExecuteJavaScriptAndExtractString( |
| 437 chrome::GetWebContentsAt(browser(), 0)->GetRenderViewHost(), | 442 chrome::GetWebContentsAt(browser(), 0)->GetRenderViewHost(), |
| 438 L"", kRetrieveSessionStorage.c_str(), &result)); | 443 L"", kRetrieveSessionStorage.c_str(), &result)); |
| 439 EXPECT_EQ("ss_normal", result); | 444 EXPECT_EQ("ss_normal", result); |
| 440 } | 445 } |
| OLD | NEW |