| 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/process/launch.h" | 9 #include "base/process/launch.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 916 #endif | 916 #endif |
| 917 | 917 |
| 918 ui_test_utils::NavigateToURL(browser(), url1_); | 918 ui_test_utils::NavigateToURL(browser(), url1_); |
| 919 | 919 |
| 920 // Launch an app. | 920 // Launch an app. |
| 921 CommandLine app_launch_arguments = GetCommandLineForRelaunch(); | 921 CommandLine app_launch_arguments = GetCommandLineForRelaunch(); |
| 922 app_launch_arguments.AppendSwitchASCII(switches::kApp, url2_.spec()); | 922 app_launch_arguments.AppendSwitchASCII(switches::kApp, url2_.spec()); |
| 923 | 923 |
| 924 ui_test_utils::BrowserAddedObserver window_observer; | 924 ui_test_utils::BrowserAddedObserver window_observer; |
| 925 | 925 |
| 926 base::LaunchProcess(app_launch_arguments, base::LaunchOptions(), NULL); | 926 base::LaunchProcess(app_launch_arguments, base::LaunchOptionsForTest(), NULL); |
| 927 | 927 |
| 928 Browser* app_window = window_observer.WaitForSingleNewBrowser(); | 928 Browser* app_window = window_observer.WaitForSingleNewBrowser(); |
| 929 ASSERT_EQ(2u, active_browser_list_->size()); | 929 ASSERT_EQ(2u, active_browser_list_->size()); |
| 930 | 930 |
| 931 // Close the first window. The only window left is the App window. | 931 // Close the first window. The only window left is the App window. |
| 932 CloseBrowserSynchronously(browser()); | 932 CloseBrowserSynchronously(browser()); |
| 933 | 933 |
| 934 // Restore the session, which should bring back the first window with url1_. | 934 // Restore the session, which should bring back the first window with url1_. |
| 935 Browser* new_browser = QuitBrowserAndRestore(app_window, 1); | 935 Browser* new_browser = QuitBrowserAndRestore(app_window, 1); |
| 936 | 936 |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1182 content::NavigationController* controller = | 1182 content::NavigationController* controller = |
| 1183 &browser()->tab_strip_model()->GetActiveWebContents()->GetController(); | 1183 &browser()->tab_strip_model()->GetActiveWebContents()->GetController(); |
| 1184 EXPECT_TRUE( | 1184 EXPECT_TRUE( |
| 1185 controller->GetDefaultSessionStorageNamespace()->should_persist()); | 1185 controller->GetDefaultSessionStorageNamespace()->should_persist()); |
| 1186 | 1186 |
| 1187 // Quit and restore. Check that no extra tabs were created. | 1187 // Quit and restore. Check that no extra tabs were created. |
| 1188 Browser* new_browser = QuitBrowserAndRestore(browser(), 1); | 1188 Browser* new_browser = QuitBrowserAndRestore(browser(), 1); |
| 1189 ASSERT_EQ(1u, active_browser_list_->size()); | 1189 ASSERT_EQ(1u, active_browser_list_->size()); |
| 1190 EXPECT_EQ(1, new_browser->tab_strip_model()->count()); | 1190 EXPECT_EQ(1, new_browser->tab_strip_model()->count()); |
| 1191 } | 1191 } |
| OLD | NEW |