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 <list> | 5 #include <list> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
(...skipping 16 matching lines...) Expand all Loading... | |
27 | 27 |
28 class SessionRestoreTestChromeOS : public InProcessBrowserTest { | 28 class SessionRestoreTestChromeOS : public InProcessBrowserTest { |
29 public: | 29 public: |
30 virtual ~SessionRestoreTestChromeOS() {} | 30 virtual ~SessionRestoreTestChromeOS() {} |
31 | 31 |
32 protected: | 32 protected: |
33 virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE { | 33 virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE { |
34 InProcessBrowserTest::SetUpCommandLine(command_line); | 34 InProcessBrowserTest::SetUpCommandLine(command_line); |
35 } | 35 } |
36 | 36 |
37 virtual void SetUpOnMainThread() OVERRIDE { | |
38 InProcessBrowserTest::SetUpOnMainThread(); | |
39 } | |
40 | |
41 virtual void TearDownOnMainThread() OVERRIDE { | |
42 InProcessBrowserTest::TearDownOnMainThread(); | |
43 for (std::list<Browser*>::iterator iter = browser_list_.begin(); | |
44 iter != browser_list_.end(); ++iter) { | |
45 CloseBrowserSynchronously(*iter); | |
46 } | |
47 browser_list_.clear(); | |
48 } | |
stevenjb
2014/07/25 16:52:48
This lgtm. As mentioned in email, this was introdu
| |
49 | |
50 Browser* CreateBrowserWithParams(Browser::CreateParams params) { | 37 Browser* CreateBrowserWithParams(Browser::CreateParams params) { |
51 Browser* browser = new Browser(params); | 38 Browser* browser = new Browser(params); |
52 AddBlankTabAndShow(browser); | 39 AddBlankTabAndShow(browser); |
53 browser_list_.push_back(browser); | 40 browser_list_.push_back(browser); |
54 return browser; | 41 return browser; |
55 } | 42 } |
56 | 43 |
57 bool CloseBrowser(Browser* browser) { | 44 bool CloseBrowser(Browser* browser) { |
58 for (std::list<Browser*>::iterator iter = browser_list_.begin(); | 45 for (std::list<Browser*>::iterator iter = browser_list_.begin(); |
59 iter != browser_list_.end(); ++iter) { | 46 iter != browser_list_.end(); ++iter) { |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
174 size_t total_count = 0; | 161 size_t total_count = 0; |
175 size_t maximized_count = 0; | 162 size_t maximized_count = 0; |
176 for (chrome::BrowserIterator it; !it.done(); it.Next()) { | 163 for (chrome::BrowserIterator it; !it.done(); it.Next()) { |
177 ++total_count; | 164 ++total_count; |
178 if (it->window()->IsMaximized()) | 165 if (it->window()->IsMaximized()) |
179 ++maximized_count; | 166 ++maximized_count; |
180 } | 167 } |
181 EXPECT_EQ(4u, total_count); | 168 EXPECT_EQ(4u, total_count); |
182 EXPECT_EQ(2u, maximized_count); | 169 EXPECT_EQ(2u, maximized_count); |
183 } | 170 } |
OLD | NEW |