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 1818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1829 IN_PROC_BROWSER_TEST_F(BrowserTest, MAYBE_PageZoom) { | 1829 IN_PROC_BROWSER_TEST_F(BrowserTest, MAYBE_PageZoom) { |
1830 WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents(); | 1830 WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents(); |
1831 bool enable_plus, enable_minus; | 1831 bool enable_plus, enable_minus; |
1832 | 1832 |
1833 { | 1833 { |
1834 scoped_refptr<content::MessageLoopRunner> loop_runner( | 1834 scoped_refptr<content::MessageLoopRunner> loop_runner( |
1835 new content::MessageLoopRunner); | 1835 new content::MessageLoopRunner); |
1836 content::HostZoomMap::ZoomLevelChangedCallback callback( | 1836 content::HostZoomMap::ZoomLevelChangedCallback callback( |
1837 base::Bind(&OnZoomLevelChanged, loop_runner->QuitClosure())); | 1837 base::Bind(&OnZoomLevelChanged, loop_runner->QuitClosure())); |
1838 scoped_ptr<content::HostZoomMap::Subscription> sub = | 1838 scoped_ptr<content::HostZoomMap::Subscription> sub = |
1839 content::HostZoomMap::GetForBrowserContext( | 1839 content::HostZoomMap::GetDefaultForBrowserContext( |
1840 browser()->profile())->AddZoomLevelChangedCallback(callback); | 1840 browser()->profile())->AddZoomLevelChangedCallback(callback); |
1841 chrome::Zoom(browser(), content::PAGE_ZOOM_IN); | 1841 chrome::Zoom(browser(), content::PAGE_ZOOM_IN); |
1842 loop_runner->Run(); | 1842 loop_runner->Run(); |
1843 sub.reset(); | 1843 sub.reset(); |
1844 EXPECT_EQ(GetZoomPercent(contents, &enable_plus, &enable_minus), 110); | 1844 EXPECT_EQ(GetZoomPercent(contents, &enable_plus, &enable_minus), 110); |
1845 EXPECT_TRUE(enable_plus); | 1845 EXPECT_TRUE(enable_plus); |
1846 EXPECT_TRUE(enable_minus); | 1846 EXPECT_TRUE(enable_minus); |
1847 } | 1847 } |
1848 | 1848 |
1849 { | 1849 { |
1850 scoped_refptr<content::MessageLoopRunner> loop_runner( | 1850 scoped_refptr<content::MessageLoopRunner> loop_runner( |
1851 new content::MessageLoopRunner); | 1851 new content::MessageLoopRunner); |
1852 content::HostZoomMap::ZoomLevelChangedCallback callback( | 1852 content::HostZoomMap::ZoomLevelChangedCallback callback( |
1853 base::Bind(&OnZoomLevelChanged, loop_runner->QuitClosure())); | 1853 base::Bind(&OnZoomLevelChanged, loop_runner->QuitClosure())); |
1854 scoped_ptr<content::HostZoomMap::Subscription> sub = | 1854 scoped_ptr<content::HostZoomMap::Subscription> sub = |
1855 content::HostZoomMap::GetForBrowserContext( | 1855 content::HostZoomMap::GetDefaultForBrowserContext( |
1856 browser()->profile())->AddZoomLevelChangedCallback(callback); | 1856 browser()->profile())->AddZoomLevelChangedCallback(callback); |
1857 chrome::Zoom(browser(), content::PAGE_ZOOM_RESET); | 1857 chrome::Zoom(browser(), content::PAGE_ZOOM_RESET); |
1858 loop_runner->Run(); | 1858 loop_runner->Run(); |
1859 sub.reset(); | 1859 sub.reset(); |
1860 EXPECT_EQ(GetZoomPercent(contents, &enable_plus, &enable_minus), 100); | 1860 EXPECT_EQ(GetZoomPercent(contents, &enable_plus, &enable_minus), 100); |
1861 EXPECT_TRUE(enable_plus); | 1861 EXPECT_TRUE(enable_plus); |
1862 EXPECT_TRUE(enable_minus); | 1862 EXPECT_TRUE(enable_minus); |
1863 } | 1863 } |
1864 | 1864 |
1865 { | 1865 { |
1866 scoped_refptr<content::MessageLoopRunner> loop_runner( | 1866 scoped_refptr<content::MessageLoopRunner> loop_runner( |
1867 new content::MessageLoopRunner); | 1867 new content::MessageLoopRunner); |
1868 content::HostZoomMap::ZoomLevelChangedCallback callback( | 1868 content::HostZoomMap::ZoomLevelChangedCallback callback( |
1869 base::Bind(&OnZoomLevelChanged, loop_runner->QuitClosure())); | 1869 base::Bind(&OnZoomLevelChanged, loop_runner->QuitClosure())); |
1870 scoped_ptr<content::HostZoomMap::Subscription> sub = | 1870 scoped_ptr<content::HostZoomMap::Subscription> sub = |
1871 content::HostZoomMap::GetForBrowserContext( | 1871 content::HostZoomMap::GetDefaultForBrowserContext( |
1872 browser()->profile())->AddZoomLevelChangedCallback(callback); | 1872 browser()->profile())->AddZoomLevelChangedCallback(callback); |
1873 chrome::Zoom(browser(), content::PAGE_ZOOM_OUT); | 1873 chrome::Zoom(browser(), content::PAGE_ZOOM_OUT); |
1874 loop_runner->Run(); | 1874 loop_runner->Run(); |
1875 sub.reset(); | 1875 sub.reset(); |
1876 EXPECT_EQ(GetZoomPercent(contents, &enable_plus, &enable_minus), 90); | 1876 EXPECT_EQ(GetZoomPercent(contents, &enable_plus, &enable_minus), 90); |
1877 EXPECT_TRUE(enable_plus); | 1877 EXPECT_TRUE(enable_plus); |
1878 EXPECT_TRUE(enable_minus); | 1878 EXPECT_TRUE(enable_minus); |
1879 } | 1879 } |
1880 | 1880 |
1881 chrome::Zoom(browser(), content::PAGE_ZOOM_RESET); | 1881 chrome::Zoom(browser(), content::PAGE_ZOOM_RESET); |
(...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2722 #endif | 2722 #endif |
2723 EXPECT_EQ(exp_commit_size, rwhv_commit_size2); | 2723 EXPECT_EQ(exp_commit_size, rwhv_commit_size2); |
2724 EXPECT_EQ(exp_commit_size, wcv_commit_size2); | 2724 EXPECT_EQ(exp_commit_size, wcv_commit_size2); |
2725 gfx::Size exp_final_size(initial_wcv_size); | 2725 gfx::Size exp_final_size(initial_wcv_size); |
2726 exp_final_size.Enlarge(wcv_resize_insets.width(), | 2726 exp_final_size.Enlarge(wcv_resize_insets.width(), |
2727 wcv_resize_insets.height() + height_inset); | 2727 wcv_resize_insets.height() + height_inset); |
2728 EXPECT_EQ(exp_final_size, | 2728 EXPECT_EQ(exp_final_size, |
2729 web_contents->GetRenderWidgetHostView()->GetViewBounds().size()); | 2729 web_contents->GetRenderWidgetHostView()->GetViewBounds().size()); |
2730 EXPECT_EQ(exp_final_size, web_contents->GetContainerBounds().size()); | 2730 EXPECT_EQ(exp_final_size, web_contents->GetContainerBounds().size()); |
2731 } | 2731 } |
OLD | NEW |