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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 content::RenderProcessHost::AllHostsIterator()); | 154 content::RenderProcessHost::AllHostsIterator()); |
155 !i.IsAtEnd(); i.Advance()) | 155 !i.IsAtEnd(); i.Advance()) |
156 ++result; | 156 ++result; |
157 return result; | 157 return result; |
158 } | 158 } |
159 | 159 |
160 class MockTabStripModelObserver : public TabStripModelObserver { | 160 class MockTabStripModelObserver : public TabStripModelObserver { |
161 public: | 161 public: |
162 MockTabStripModelObserver() : closing_count_(0) {} | 162 MockTabStripModelObserver() : closing_count_(0) {} |
163 | 163 |
164 virtual void TabClosingAt(TabStripModel* tab_strip_model, | 164 void TabClosingAt(TabStripModel* tab_strip_model, |
165 WebContents* contents, | 165 WebContents* contents, |
166 int index) override { | 166 int index) override { |
167 ++closing_count_; | 167 ++closing_count_; |
168 } | 168 } |
169 | 169 |
170 int closing_count() const { return closing_count_; } | 170 int closing_count() const { return closing_count_; } |
171 | 171 |
172 private: | 172 private: |
173 int closing_count_; | 173 int closing_count_; |
174 | 174 |
175 DISALLOW_COPY_AND_ASSIGN(MockTabStripModelObserver); | 175 DISALLOW_COPY_AND_ASSIGN(MockTabStripModelObserver); |
176 }; | 176 }; |
177 | 177 |
178 // Causes the browser to swap processes on a redirect to an HTTPS URL. | 178 // Causes the browser to swap processes on a redirect to an HTTPS URL. |
179 class TransferHttpsRedirectsContentBrowserClient | 179 class TransferHttpsRedirectsContentBrowserClient |
180 : public chrome::ChromeContentBrowserClient { | 180 : public chrome::ChromeContentBrowserClient { |
181 public: | 181 public: |
182 virtual bool ShouldSwapProcessesForRedirect( | 182 bool ShouldSwapProcessesForRedirect( |
183 content::ResourceContext* resource_context, | 183 content::ResourceContext* resource_context, |
184 const GURL& current_url, | 184 const GURL& current_url, |
185 const GURL& new_url) override { | 185 const GURL& new_url) override { |
186 return new_url.SchemeIs(url::kHttpsScheme); | 186 return new_url.SchemeIs(url::kHttpsScheme); |
187 } | 187 } |
188 }; | 188 }; |
189 | 189 |
190 // Used by CloseWithAppMenuOpen. Invokes CloseWindow on the supplied browser. | 190 // Used by CloseWithAppMenuOpen. Invokes CloseWindow on the supplied browser. |
191 void CloseWindowCallback(Browser* browser) { | 191 void CloseWindowCallback(Browser* browser) { |
192 chrome::CloseWindow(browser); | 192 chrome::CloseWindow(browser); |
(...skipping 11 matching lines...) Expand all Loading... |
204 // Displays "INTERSTITIAL" while the interstitial is attached. | 204 // Displays "INTERSTITIAL" while the interstitial is attached. |
205 // (InterstitialPage can be used in a test directly, but there would be no way | 205 // (InterstitialPage can be used in a test directly, but there would be no way |
206 // to visually tell if it is showing or not.) | 206 // to visually tell if it is showing or not.) |
207 class TestInterstitialPage : public content::InterstitialPageDelegate { | 207 class TestInterstitialPage : public content::InterstitialPageDelegate { |
208 public: | 208 public: |
209 TestInterstitialPage(WebContents* tab, bool new_navigation, const GURL& url) { | 209 TestInterstitialPage(WebContents* tab, bool new_navigation, const GURL& url) { |
210 interstitial_page_ = InterstitialPage::Create( | 210 interstitial_page_ = InterstitialPage::Create( |
211 tab, new_navigation, url , this); | 211 tab, new_navigation, url , this); |
212 interstitial_page_->Show(); | 212 interstitial_page_->Show(); |
213 } | 213 } |
214 virtual ~TestInterstitialPage() { } | 214 ~TestInterstitialPage() override {} |
215 void Proceed() { | 215 void Proceed() { |
216 interstitial_page_->Proceed(); | 216 interstitial_page_->Proceed(); |
217 } | 217 } |
218 void DontProceed() { | 218 void DontProceed() { |
219 interstitial_page_->DontProceed(); | 219 interstitial_page_->DontProceed(); |
220 } | 220 } |
221 | 221 |
222 virtual std::string GetHTMLContents() override { | 222 std::string GetHTMLContents() override { return "<h1>INTERSTITIAL</h1>"; } |
223 return "<h1>INTERSTITIAL</h1>"; | |
224 } | |
225 | 223 |
226 private: | 224 private: |
227 InterstitialPage* interstitial_page_; // Owns us. | 225 InterstitialPage* interstitial_page_; // Owns us. |
228 }; | 226 }; |
229 | 227 |
230 class RenderViewSizeObserver : public content::WebContentsObserver { | 228 class RenderViewSizeObserver : public content::WebContentsObserver { |
231 public: | 229 public: |
232 RenderViewSizeObserver(content::WebContents* web_contents, | 230 RenderViewSizeObserver(content::WebContents* web_contents, |
233 BrowserWindow* browser_window) | 231 BrowserWindow* browser_window) |
234 : WebContentsObserver(web_contents), | 232 : WebContentsObserver(web_contents), |
(...skipping 12 matching lines...) Expand all Loading... |
247 *rwhv_commit_size = result->second.rwhv_commit_size; | 245 *rwhv_commit_size = result->second.rwhv_commit_size; |
248 *wcv_commit_size = result->second.wcv_commit_size; | 246 *wcv_commit_size = result->second.wcv_commit_size; |
249 } | 247 } |
250 } | 248 } |
251 | 249 |
252 void set_wcv_resize_insets(const gfx::Size& wcv_resize_insets) { | 250 void set_wcv_resize_insets(const gfx::Size& wcv_resize_insets) { |
253 wcv_resize_insets_ = wcv_resize_insets; | 251 wcv_resize_insets_ = wcv_resize_insets; |
254 } | 252 } |
255 | 253 |
256 // Cache the size when RenderViewHost is first created. | 254 // Cache the size when RenderViewHost is first created. |
257 virtual void RenderViewCreated( | 255 void RenderViewCreated(content::RenderViewHost* render_view_host) override { |
258 content::RenderViewHost* render_view_host) override { | |
259 render_view_sizes_[render_view_host].rwhv_create_size = | 256 render_view_sizes_[render_view_host].rwhv_create_size = |
260 render_view_host->GetView()->GetViewBounds().size(); | 257 render_view_host->GetView()->GetViewBounds().size(); |
261 } | 258 } |
262 | 259 |
263 // Enlarge WebContentsView by |wcv_resize_insets_| while the navigation entry | 260 // Enlarge WebContentsView by |wcv_resize_insets_| while the navigation entry |
264 // is pending. | 261 // is pending. |
265 virtual void DidStartNavigationToPendingEntry( | 262 void DidStartNavigationToPendingEntry( |
266 const GURL& url, | 263 const GURL& url, |
267 NavigationController::ReloadType reload_type) override { | 264 NavigationController::ReloadType reload_type) override { |
268 if (wcv_resize_insets_.IsEmpty()) | 265 if (wcv_resize_insets_.IsEmpty()) |
269 return; | 266 return; |
270 // Resizing the main browser window by |wcv_resize_insets_| will | 267 // Resizing the main browser window by |wcv_resize_insets_| will |
271 // automatically resize the WebContentsView by the same amount. | 268 // automatically resize the WebContentsView by the same amount. |
272 // Just resizing WebContentsView directly doesn't work on Linux, because the | 269 // Just resizing WebContentsView directly doesn't work on Linux, because the |
273 // next automatic layout of the browser window will resize WebContentsView | 270 // next automatic layout of the browser window will resize WebContentsView |
274 // back to the previous size. To make it consistent, resize main browser | 271 // back to the previous size. To make it consistent, resize main browser |
275 // window on all platforms. | 272 // window on all platforms. |
276 gfx::Rect bounds(browser_window_->GetBounds()); | 273 gfx::Rect bounds(browser_window_->GetBounds()); |
277 gfx::Size size(bounds.size()); | 274 gfx::Size size(bounds.size()); |
278 size.Enlarge(wcv_resize_insets_.width(), wcv_resize_insets_.height()); | 275 size.Enlarge(wcv_resize_insets_.width(), wcv_resize_insets_.height()); |
279 bounds.set_size(size); | 276 bounds.set_size(size); |
280 browser_window_->SetBounds(bounds); | 277 browser_window_->SetBounds(bounds); |
281 // Let the message loop run so that resize actually takes effect. | 278 // Let the message loop run so that resize actually takes effect. |
282 content::RunAllPendingInMessageLoop(); | 279 content::RunAllPendingInMessageLoop(); |
283 } | 280 } |
284 | 281 |
285 // Cache the sizes of RenderWidgetHostView and WebContentsView when the | 282 // Cache the sizes of RenderWidgetHostView and WebContentsView when the |
286 // navigation entry is committed, which is before | 283 // navigation entry is committed, which is before |
287 // WebContentsDelegate::DidNavigateMainFramePostCommit is called. | 284 // WebContentsDelegate::DidNavigateMainFramePostCommit is called. |
288 virtual void NavigationEntryCommitted( | 285 void NavigationEntryCommitted( |
289 const content::LoadCommittedDetails& details) override { | 286 const content::LoadCommittedDetails& details) override { |
290 content::RenderViewHost* rvh = web_contents()->GetRenderViewHost(); | 287 content::RenderViewHost* rvh = web_contents()->GetRenderViewHost(); |
291 render_view_sizes_[rvh].rwhv_commit_size = | 288 render_view_sizes_[rvh].rwhv_commit_size = |
292 web_contents()->GetRenderWidgetHostView()->GetViewBounds().size(); | 289 web_contents()->GetRenderWidgetHostView()->GetViewBounds().size(); |
293 render_view_sizes_[rvh].wcv_commit_size = | 290 render_view_sizes_[rvh].wcv_commit_size = |
294 web_contents()->GetContainerBounds().size(); | 291 web_contents()->GetContainerBounds().size(); |
295 } | 292 } |
296 | 293 |
297 private: | 294 private: |
298 struct Sizes { | 295 struct Sizes { |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
597 browser()->tab_strip_model()->GetActiveWebContents()->GetMainFrame()-> | 594 browser()->tab_strip_model()->GetActiveWebContents()->GetMainFrame()-> |
598 ExecuteJavaScript(ASCIIToUTF16("onbeforeunload=null;")); | 595 ExecuteJavaScript(ASCIIToUTF16("onbeforeunload=null;")); |
599 } | 596 } |
600 | 597 |
601 class RedirectObserver : public content::WebContentsObserver { | 598 class RedirectObserver : public content::WebContentsObserver { |
602 public: | 599 public: |
603 explicit RedirectObserver(content::WebContents* web_contents) | 600 explicit RedirectObserver(content::WebContents* web_contents) |
604 : WebContentsObserver(web_contents) { | 601 : WebContentsObserver(web_contents) { |
605 } | 602 } |
606 | 603 |
607 virtual void DidNavigateAnyFrame( | 604 void DidNavigateAnyFrame( |
608 content::RenderFrameHost* render_frame_host, | 605 content::RenderFrameHost* render_frame_host, |
609 const content::LoadCommittedDetails& details, | 606 const content::LoadCommittedDetails& details, |
610 const content::FrameNavigateParams& params) override { | 607 const content::FrameNavigateParams& params) override { |
611 params_ = params; | 608 params_ = params; |
612 } | 609 } |
613 | 610 |
614 virtual void WebContentsDestroyed() override { | 611 void WebContentsDestroyed() override { |
615 // Make sure we don't close the tab while the observer is in scope. | 612 // Make sure we don't close the tab while the observer is in scope. |
616 // See http://crbug.com/314036. | 613 // See http://crbug.com/314036. |
617 FAIL() << "WebContents closed during navigation (http://crbug.com/314036)."; | 614 FAIL() << "WebContents closed during navigation (http://crbug.com/314036)."; |
618 } | 615 } |
619 | 616 |
620 const content::FrameNavigateParams& params() const { | 617 const content::FrameNavigateParams& params() const { |
621 return params_; | 618 return params_; |
622 } | 619 } |
623 | 620 |
624 private: | 621 private: |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
816 } | 813 } |
817 | 814 |
818 // BeforeUnloadAtQuitWithTwoWindows is a regression test for | 815 // BeforeUnloadAtQuitWithTwoWindows is a regression test for |
819 // http://crbug.com/11842. It opens two windows, one of which has a | 816 // http://crbug.com/11842. It opens two windows, one of which has a |
820 // beforeunload handler and attempts to exit cleanly. | 817 // beforeunload handler and attempts to exit cleanly. |
821 class BeforeUnloadAtQuitWithTwoWindows : public InProcessBrowserTest { | 818 class BeforeUnloadAtQuitWithTwoWindows : public InProcessBrowserTest { |
822 public: | 819 public: |
823 // This test is for testing a specific shutdown behavior. This mimics what | 820 // This test is for testing a specific shutdown behavior. This mimics what |
824 // happens in InProcessBrowserTest::RunTestOnMainThread and QuitBrowsers, but | 821 // happens in InProcessBrowserTest::RunTestOnMainThread and QuitBrowsers, but |
825 // ensures that it happens through the single IDC_EXIT of the test. | 822 // ensures that it happens through the single IDC_EXIT of the test. |
826 virtual void TearDownOnMainThread() override { | 823 void TearDownOnMainThread() override { |
827 // Cycle both the MessageLoop and the Cocoa runloop twice to flush out any | 824 // Cycle both the MessageLoop and the Cocoa runloop twice to flush out any |
828 // Chrome work that generates Cocoa work. Do this twice since there are two | 825 // Chrome work that generates Cocoa work. Do this twice since there are two |
829 // Browsers that must be closed. | 826 // Browsers that must be closed. |
830 CycleRunLoops(); | 827 CycleRunLoops(); |
831 CycleRunLoops(); | 828 CycleRunLoops(); |
832 | 829 |
833 // Run the application event loop to completion, which will cycle the | 830 // Run the application event loop to completion, which will cycle the |
834 // native MessagePump on all platforms. | 831 // native MessagePump on all platforms. |
835 base::MessageLoop::current()->PostTask(FROM_HERE, | 832 base::MessageLoop::current()->PostTask(FROM_HERE, |
836 base::MessageLoop::QuitClosure()); | 833 base::MessageLoop::QuitClosure()); |
(...skipping 1104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1941 // interstitial is deleted now. | 1938 // interstitial is deleted now. |
1942 } | 1939 } |
1943 | 1940 |
1944 class MockWebContentsObserver : public WebContentsObserver { | 1941 class MockWebContentsObserver : public WebContentsObserver { |
1945 public: | 1942 public: |
1946 explicit MockWebContentsObserver(WebContents* web_contents) | 1943 explicit MockWebContentsObserver(WebContents* web_contents) |
1947 : WebContentsObserver(web_contents), | 1944 : WebContentsObserver(web_contents), |
1948 got_user_gesture_(false) { | 1945 got_user_gesture_(false) { |
1949 } | 1946 } |
1950 | 1947 |
1951 virtual void DidGetUserGesture() override { | 1948 void DidGetUserGesture() override { got_user_gesture_ = true; } |
1952 got_user_gesture_ = true; | |
1953 } | |
1954 | 1949 |
1955 bool got_user_gesture() const { | 1950 bool got_user_gesture() const { |
1956 return got_user_gesture_; | 1951 return got_user_gesture_; |
1957 } | 1952 } |
1958 | 1953 |
1959 void set_got_user_gesture(bool got_it) { | 1954 void set_got_user_gesture(bool got_it) { |
1960 got_user_gesture_ = got_it; | 1955 got_user_gesture_ = got_it; |
1961 } | 1956 } |
1962 | 1957 |
1963 private: | 1958 private: |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2120 browser()->tab_strip_model()->GetActiveWebContents(), expected_title); | 2115 browser()->tab_strip_model()->GetActiveWebContents(), expected_title); |
2121 title_watcher.AlsoWaitForTitle(ASCIIToUTF16("Allowed")); | 2116 title_watcher.AlsoWaitForTitle(ASCIIToUTF16("Allowed")); |
2122 ui_test_utils::NavigateToURL(browser(), url); | 2117 ui_test_utils::NavigateToURL(browser(), url); |
2123 ASSERT_EQ(expected_title, title_watcher.WaitAndGetTitle()); | 2118 ASSERT_EQ(expected_title, title_watcher.WaitAndGetTitle()); |
2124 } | 2119 } |
2125 | 2120 |
2126 class KioskModeTest : public BrowserTest { | 2121 class KioskModeTest : public BrowserTest { |
2127 public: | 2122 public: |
2128 KioskModeTest() {} | 2123 KioskModeTest() {} |
2129 | 2124 |
2130 virtual void SetUpCommandLine(CommandLine* command_line) override { | 2125 void SetUpCommandLine(CommandLine* command_line) override { |
2131 command_line->AppendSwitch(switches::kKioskMode); | 2126 command_line->AppendSwitch(switches::kKioskMode); |
2132 } | 2127 } |
2133 }; | 2128 }; |
2134 | 2129 |
2135 #if defined(OS_MACOSX) || (defined(OS_LINUX) && !defined(OS_CHROMEOS)) | 2130 #if defined(OS_MACOSX) || (defined(OS_LINUX) && !defined(OS_CHROMEOS)) |
2136 // Mac: http://crbug.com/103912 | 2131 // Mac: http://crbug.com/103912 |
2137 // Linux: http://crbug.com/163931 | 2132 // Linux: http://crbug.com/163931 |
2138 #define MAYBE_EnableKioskModeTest DISABLED_EnableKioskModeTest | 2133 #define MAYBE_EnableKioskModeTest DISABLED_EnableKioskModeTest |
2139 #else | 2134 #else |
2140 #define MAYBE_EnableKioskModeTest EnableKioskModeTest | 2135 #define MAYBE_EnableKioskModeTest EnableKioskModeTest |
(...skipping 29 matching lines...) Expand all Loading... |
2170 ASSERT_TRUE(browser()); | 2165 ASSERT_TRUE(browser()); |
2171 } | 2166 } |
2172 #endif // defined(OS_WIN) | 2167 #endif // defined(OS_WIN) |
2173 | 2168 |
2174 // Tests to ensure that the browser continues running in the background after | 2169 // Tests to ensure that the browser continues running in the background after |
2175 // the last window closes. | 2170 // the last window closes. |
2176 class RunInBackgroundTest : public BrowserTest { | 2171 class RunInBackgroundTest : public BrowserTest { |
2177 public: | 2172 public: |
2178 RunInBackgroundTest() {} | 2173 RunInBackgroundTest() {} |
2179 | 2174 |
2180 virtual void SetUpCommandLine(CommandLine* command_line) override { | 2175 void SetUpCommandLine(CommandLine* command_line) override { |
2181 command_line->AppendSwitch(switches::kKeepAliveForTest); | 2176 command_line->AppendSwitch(switches::kKeepAliveForTest); |
2182 } | 2177 } |
2183 }; | 2178 }; |
2184 | 2179 |
2185 IN_PROC_BROWSER_TEST_F(RunInBackgroundTest, RunInBackgroundBasicTest) { | 2180 IN_PROC_BROWSER_TEST_F(RunInBackgroundTest, RunInBackgroundBasicTest) { |
2186 // Close the browser window, then open a new one - the browser should keep | 2181 // Close the browser window, then open a new one - the browser should keep |
2187 // running. | 2182 // running. |
2188 Profile* profile = browser()->profile(); | 2183 Profile* profile = browser()->profile(); |
2189 EXPECT_EQ(1u, chrome::GetTotalBrowserCount()); | 2184 EXPECT_EQ(1u, chrome::GetTotalBrowserCount()); |
2190 content::WindowedNotificationObserver observer( | 2185 content::WindowedNotificationObserver observer( |
2191 chrome::NOTIFICATION_BROWSER_CLOSED, | 2186 chrome::NOTIFICATION_BROWSER_CLOSED, |
2192 content::Source<Browser>(browser())); | 2187 content::Source<Browser>(browser())); |
2193 chrome::CloseWindow(browser()); | 2188 chrome::CloseWindow(browser()); |
2194 observer.Wait(); | 2189 observer.Wait(); |
2195 EXPECT_EQ(0u, chrome::GetTotalBrowserCount()); | 2190 EXPECT_EQ(0u, chrome::GetTotalBrowserCount()); |
2196 | 2191 |
2197 ui_test_utils::BrowserAddedObserver browser_added_observer; | 2192 ui_test_utils::BrowserAddedObserver browser_added_observer; |
2198 chrome::NewEmptyWindow(profile, chrome::GetActiveDesktop()); | 2193 chrome::NewEmptyWindow(profile, chrome::GetActiveDesktop()); |
2199 browser_added_observer.WaitForSingleNewBrowser(); | 2194 browser_added_observer.WaitForSingleNewBrowser(); |
2200 | 2195 |
2201 EXPECT_EQ(1u, chrome::GetTotalBrowserCount()); | 2196 EXPECT_EQ(1u, chrome::GetTotalBrowserCount()); |
2202 } | 2197 } |
2203 | 2198 |
2204 // Tests to ensure that the browser continues running in the background after | 2199 // Tests to ensure that the browser continues running in the background after |
2205 // the last window closes. | 2200 // the last window closes. |
2206 class NoStartupWindowTest : public BrowserTest { | 2201 class NoStartupWindowTest : public BrowserTest { |
2207 public: | 2202 public: |
2208 NoStartupWindowTest() {} | 2203 NoStartupWindowTest() {} |
2209 | 2204 |
2210 virtual void SetUpCommandLine(CommandLine* command_line) override { | 2205 void SetUpCommandLine(CommandLine* command_line) override { |
2211 command_line->AppendSwitch(switches::kNoStartupWindow); | 2206 command_line->AppendSwitch(switches::kNoStartupWindow); |
2212 command_line->AppendSwitch(switches::kKeepAliveForTest); | 2207 command_line->AppendSwitch(switches::kKeepAliveForTest); |
2213 } | 2208 } |
2214 }; | 2209 }; |
2215 | 2210 |
2216 IN_PROC_BROWSER_TEST_F(NoStartupWindowTest, NoStartupWindowBasicTest) { | 2211 IN_PROC_BROWSER_TEST_F(NoStartupWindowTest, NoStartupWindowBasicTest) { |
2217 #if defined(OS_WIN) && defined(USE_ASH) | 2212 #if defined(OS_WIN) && defined(USE_ASH) |
2218 // kNoStartupWindow doesn't make sense in Metro+Ash. | 2213 // kNoStartupWindow doesn't make sense in Metro+Ash. |
2219 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) | 2214 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) |
2220 return; | 2215 return; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2254 ASSERT_FALSE(session_service->processed_any_commands()); | 2249 ASSERT_FALSE(session_service->processed_any_commands()); |
2255 } | 2250 } |
2256 #endif // !defined(OS_CHROMEOS) | 2251 #endif // !defined(OS_CHROMEOS) |
2257 | 2252 |
2258 // This test needs to be placed outside the anonymous namespace because we | 2253 // This test needs to be placed outside the anonymous namespace because we |
2259 // need to access private type of Browser. | 2254 // need to access private type of Browser. |
2260 class AppModeTest : public BrowserTest { | 2255 class AppModeTest : public BrowserTest { |
2261 public: | 2256 public: |
2262 AppModeTest() {} | 2257 AppModeTest() {} |
2263 | 2258 |
2264 virtual void SetUpCommandLine(CommandLine* command_line) override { | 2259 void SetUpCommandLine(CommandLine* command_line) override { |
2265 GURL url = ui_test_utils::GetTestUrl( | 2260 GURL url = ui_test_utils::GetTestUrl( |
2266 base::FilePath(), base::FilePath().AppendASCII("title1.html")); | 2261 base::FilePath(), base::FilePath().AppendASCII("title1.html")); |
2267 command_line->AppendSwitchASCII(switches::kApp, url.spec()); | 2262 command_line->AppendSwitchASCII(switches::kApp, url.spec()); |
2268 } | 2263 } |
2269 }; | 2264 }; |
2270 | 2265 |
2271 IN_PROC_BROWSER_TEST_F(AppModeTest, EnableAppModeTest) { | 2266 IN_PROC_BROWSER_TEST_F(AppModeTest, EnableAppModeTest) { |
2272 #if defined(OS_WIN) && defined(USE_ASH) | 2267 #if defined(OS_WIN) && defined(USE_ASH) |
2273 // Disable this test in Metro+Ash for now (http://crbug.com/262796). | 2268 // Disable this test in Metro+Ash for now (http://crbug.com/262796). |
2274 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) | 2269 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2646 #endif | 2641 #endif |
2647 EXPECT_EQ(exp_commit_size, rwhv_commit_size2); | 2642 EXPECT_EQ(exp_commit_size, rwhv_commit_size2); |
2648 EXPECT_EQ(exp_commit_size, wcv_commit_size2); | 2643 EXPECT_EQ(exp_commit_size, wcv_commit_size2); |
2649 gfx::Size exp_final_size(initial_wcv_size); | 2644 gfx::Size exp_final_size(initial_wcv_size); |
2650 exp_final_size.Enlarge(wcv_resize_insets.width(), | 2645 exp_final_size.Enlarge(wcv_resize_insets.width(), |
2651 wcv_resize_insets.height() + height_inset); | 2646 wcv_resize_insets.height() + height_inset); |
2652 EXPECT_EQ(exp_final_size, | 2647 EXPECT_EQ(exp_final_size, |
2653 web_contents->GetRenderWidgetHostView()->GetViewBounds().size()); | 2648 web_contents->GetRenderWidgetHostView()->GetViewBounds().size()); |
2654 EXPECT_EQ(exp_final_size, web_contents->GetContainerBounds().size()); | 2649 EXPECT_EQ(exp_final_size, web_contents->GetContainerBounds().size()); |
2655 } | 2650 } |
OLD | NEW |