| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 | 78 |
| 79 class SessionRestoreTest : public InProcessBrowserTest { | 79 class SessionRestoreTest : public InProcessBrowserTest { |
| 80 public: | 80 public: |
| 81 SessionRestoreTest() : active_browser_list_(NULL) {} | 81 SessionRestoreTest() : active_browser_list_(NULL) {} |
| 82 | 82 |
| 83 protected: | 83 protected: |
| 84 #if defined(OS_CHROMEOS) | 84 #if defined(OS_CHROMEOS) |
| 85 void SetUpCommandLine(base::CommandLine* command_line) override { | 85 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 86 // TODO(nkostylev): Investigate if we can remove this switch. | 86 // TODO(nkostylev): Investigate if we can remove this switch. |
| 87 command_line->AppendSwitch(switches::kCreateBrowserOnStartupForTests); | 87 command_line->AppendSwitch(switches::kCreateBrowserOnStartupForTests); |
| 88 InProcessBrowserTest::SetUpCommandLine(command_line); | |
| 89 } | 88 } |
| 90 #endif | 89 #endif |
| 91 | 90 |
| 92 void SetUpOnMainThread() override { | 91 void SetUpOnMainThread() override { |
| 93 active_browser_list_ = BrowserList::GetInstance(); | 92 active_browser_list_ = BrowserList::GetInstance(); |
| 94 | 93 |
| 95 SessionStartupPref pref(SessionStartupPref::LAST); | 94 SessionStartupPref pref(SessionStartupPref::LAST); |
| 96 SessionStartupPref::SetStartupPref(browser()->profile(), pref); | 95 SessionStartupPref::SetStartupPref(browser()->profile(), pref); |
| 97 #if defined(OS_CHROMEOS) | 96 #if defined(OS_CHROMEOS) |
| 98 const testing::TestInfo* const test_info = | 97 const testing::TestInfo* const test_info = |
| (...skipping 1563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1662 StartupURLsWithSessionRestore) { | 1661 StartupURLsWithSessionRestore) { |
| 1663 // Check that browser is started with restored session and | 1662 // Check that browser is started with restored session and |
| 1664 // tab with startup URL next to it. | 1663 // tab with startup URL next to it. |
| 1665 TabStripModel* tab_strip = browser()->tab_strip_model(); | 1664 TabStripModel* tab_strip = browser()->tab_strip_model(); |
| 1666 ASSERT_EQ(2, tab_strip->count()); | 1665 ASSERT_EQ(2, tab_strip->count()); |
| 1667 EXPECT_EQ(kSessionURL, | 1666 EXPECT_EQ(kSessionURL, |
| 1668 tab_strip->GetWebContentsAt(0)->GetURL().possibly_invalid_spec()); | 1667 tab_strip->GetWebContentsAt(0)->GetURL().possibly_invalid_spec()); |
| 1669 EXPECT_EQ(kStartupURL, | 1668 EXPECT_EQ(kStartupURL, |
| 1670 tab_strip->GetWebContentsAt(1)->GetURL().possibly_invalid_spec()); | 1669 tab_strip->GetWebContentsAt(1)->GetURL().possibly_invalid_spec()); |
| 1671 } | 1670 } |
| OLD | NEW |