| 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 1571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1582 #endif | 1582 #endif |
| 1583 IN_PROC_BROWSER_TEST_F(BrowserTest, MAYBE_PageZoom) { | 1583 IN_PROC_BROWSER_TEST_F(BrowserTest, MAYBE_PageZoom) { |
| 1584 WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents(); | 1584 WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents(); |
| 1585 bool enable_plus, enable_minus; | 1585 bool enable_plus, enable_minus; |
| 1586 | 1586 |
| 1587 { | 1587 { |
| 1588 scoped_refptr<content::MessageLoopRunner> loop_runner( | 1588 scoped_refptr<content::MessageLoopRunner> loop_runner( |
| 1589 new content::MessageLoopRunner); | 1589 new content::MessageLoopRunner); |
| 1590 content::HostZoomMap::ZoomLevelChangedCallback callback( | 1590 content::HostZoomMap::ZoomLevelChangedCallback callback( |
| 1591 base::Bind(&OnZoomLevelChanged, loop_runner->QuitClosure())); | 1591 base::Bind(&OnZoomLevelChanged, loop_runner->QuitClosure())); |
| 1592 content::HostZoomMap::GetForBrowserContext( | 1592 scoped_ptr<content::HostZoomMap::Subscription> sub = |
| 1593 browser()->profile())->AddZoomLevelChangedCallback(callback); | 1593 content::HostZoomMap::GetForBrowserContext( |
| 1594 browser()->profile())->AddZoomLevelChangedCallback(callback); |
| 1594 chrome::Zoom(browser(), content::PAGE_ZOOM_IN); | 1595 chrome::Zoom(browser(), content::PAGE_ZOOM_IN); |
| 1595 loop_runner->Run(); | 1596 loop_runner->Run(); |
| 1596 content::HostZoomMap::GetForBrowserContext( | 1597 sub.reset(); |
| 1597 browser()->profile())->RemoveZoomLevelChangedCallback(callback); | |
| 1598 EXPECT_EQ(contents->GetZoomPercent(&enable_plus, &enable_minus), 110); | 1598 EXPECT_EQ(contents->GetZoomPercent(&enable_plus, &enable_minus), 110); |
| 1599 EXPECT_TRUE(enable_plus); | 1599 EXPECT_TRUE(enable_plus); |
| 1600 EXPECT_TRUE(enable_minus); | 1600 EXPECT_TRUE(enable_minus); |
| 1601 } | 1601 } |
| 1602 | 1602 |
| 1603 { | 1603 { |
| 1604 scoped_refptr<content::MessageLoopRunner> loop_runner( | 1604 scoped_refptr<content::MessageLoopRunner> loop_runner( |
| 1605 new content::MessageLoopRunner); | 1605 new content::MessageLoopRunner); |
| 1606 content::HostZoomMap::ZoomLevelChangedCallback callback( | 1606 content::HostZoomMap::ZoomLevelChangedCallback callback( |
| 1607 base::Bind(&OnZoomLevelChanged, loop_runner->QuitClosure())); | 1607 base::Bind(&OnZoomLevelChanged, loop_runner->QuitClosure())); |
| 1608 content::HostZoomMap::GetForBrowserContext( | 1608 scoped_ptr<content::HostZoomMap::Subscription> sub = |
| 1609 browser()->profile())->AddZoomLevelChangedCallback(callback); | 1609 content::HostZoomMap::GetForBrowserContext( |
| 1610 browser()->profile())->AddZoomLevelChangedCallback(callback); |
| 1610 chrome::Zoom(browser(), content::PAGE_ZOOM_RESET); | 1611 chrome::Zoom(browser(), content::PAGE_ZOOM_RESET); |
| 1611 loop_runner->Run(); | 1612 loop_runner->Run(); |
| 1612 content::HostZoomMap::GetForBrowserContext( | 1613 sub.reset(); |
| 1613 browser()->profile())->RemoveZoomLevelChangedCallback(callback); | |
| 1614 EXPECT_EQ(contents->GetZoomPercent(&enable_plus, &enable_minus), 100); | 1614 EXPECT_EQ(contents->GetZoomPercent(&enable_plus, &enable_minus), 100); |
| 1615 EXPECT_TRUE(enable_plus); | 1615 EXPECT_TRUE(enable_plus); |
| 1616 EXPECT_TRUE(enable_minus); | 1616 EXPECT_TRUE(enable_minus); |
| 1617 } | 1617 } |
| 1618 | 1618 |
| 1619 { | 1619 { |
| 1620 scoped_refptr<content::MessageLoopRunner> loop_runner( | 1620 scoped_refptr<content::MessageLoopRunner> loop_runner( |
| 1621 new content::MessageLoopRunner); | 1621 new content::MessageLoopRunner); |
| 1622 content::HostZoomMap::ZoomLevelChangedCallback callback( | 1622 content::HostZoomMap::ZoomLevelChangedCallback callback( |
| 1623 base::Bind(&OnZoomLevelChanged, loop_runner->QuitClosure())); | 1623 base::Bind(&OnZoomLevelChanged, loop_runner->QuitClosure())); |
| 1624 content::HostZoomMap::GetForBrowserContext( | 1624 scoped_ptr<content::HostZoomMap::Subscription> sub = |
| 1625 browser()->profile())->AddZoomLevelChangedCallback(callback); | 1625 content::HostZoomMap::GetForBrowserContext( |
| 1626 browser()->profile())->AddZoomLevelChangedCallback(callback); |
| 1626 chrome::Zoom(browser(), content::PAGE_ZOOM_OUT); | 1627 chrome::Zoom(browser(), content::PAGE_ZOOM_OUT); |
| 1627 loop_runner->Run(); | 1628 loop_runner->Run(); |
| 1628 content::HostZoomMap::GetForBrowserContext( | 1629 sub.reset(); |
| 1629 browser()->profile())->RemoveZoomLevelChangedCallback(callback); | |
| 1630 EXPECT_EQ(contents->GetZoomPercent(&enable_plus, &enable_minus), 90); | 1630 EXPECT_EQ(contents->GetZoomPercent(&enable_plus, &enable_minus), 90); |
| 1631 EXPECT_TRUE(enable_plus); | 1631 EXPECT_TRUE(enable_plus); |
| 1632 EXPECT_TRUE(enable_minus); | 1632 EXPECT_TRUE(enable_minus); |
| 1633 } | 1633 } |
| 1634 | 1634 |
| 1635 chrome::Zoom(browser(), content::PAGE_ZOOM_RESET); | 1635 chrome::Zoom(browser(), content::PAGE_ZOOM_RESET); |
| 1636 } | 1636 } |
| 1637 | 1637 |
| 1638 IN_PROC_BROWSER_TEST_F(BrowserTest, InterstitialCommandDisable) { | 1638 IN_PROC_BROWSER_TEST_F(BrowserTest, InterstitialCommandDisable) { |
| 1639 ASSERT_TRUE(test_server()->Start()); | 1639 ASSERT_TRUE(test_server()->Start()); |
| (...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2473 exp_commit_size.Enlarge(wcv_resize_insets.width(), | 2473 exp_commit_size.Enlarge(wcv_resize_insets.width(), |
| 2474 wcv_resize_insets.height() + height_inset); | 2474 wcv_resize_insets.height() + height_inset); |
| 2475 EXPECT_EQ(exp_commit_size, rwhv_commit_size2); | 2475 EXPECT_EQ(exp_commit_size, rwhv_commit_size2); |
| 2476 EXPECT_EQ(exp_commit_size, wcv_commit_size2); | 2476 EXPECT_EQ(exp_commit_size, wcv_commit_size2); |
| 2477 // Sizes of RenderWidgetHostView and WebContentsView before and after | 2477 // Sizes of RenderWidgetHostView and WebContentsView before and after |
| 2478 // WebContentsDelegate::DidNavigateMainFramePostCommit should be the same. | 2478 // WebContentsDelegate::DidNavigateMainFramePostCommit should be the same. |
| 2479 EXPECT_EQ(rwhv_commit_size2, | 2479 EXPECT_EQ(rwhv_commit_size2, |
| 2480 web_contents->GetRenderWidgetHostView()->GetViewBounds().size()); | 2480 web_contents->GetRenderWidgetHostView()->GetViewBounds().size()); |
| 2481 EXPECT_EQ(wcv_commit_size2, web_contents->GetView()->GetContainerSize()); | 2481 EXPECT_EQ(wcv_commit_size2, web_contents->GetView()->GetContainerSize()); |
| 2482 } | 2482 } |
| OLD | NEW |