| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/public/browser/host_zoom_map.h" | 5 #include "content/public/browser/host_zoom_map.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/bind.h" | 13 #include "base/bind.h" |
| 14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
| 15 #include "base/files/file_path.h" | 15 #include "base/files/file_path.h" |
| 16 #include "base/files/file_util.h" | 16 #include "base/files/file_util.h" |
| 17 #include "base/macros.h" | 17 #include "base/macros.h" |
| 18 #include "base/memory/ref_counted.h" | 18 #include "base/memory/ref_counted.h" |
| 19 #include "base/memory/scoped_ptr.h" | 19 #include "base/memory/scoped_ptr.h" |
| 20 #include "base/path_service.h" | 20 #include "base/path_service.h" |
| 21 #include "base/prefs/pref_service.h" | |
| 22 #include "base/strings/stringprintf.h" | 21 #include "base/strings/stringprintf.h" |
| 23 #include "base/values.h" | 22 #include "base/values.h" |
| 24 #include "chrome/browser/profiles/profile.h" | 23 #include "chrome/browser/profiles/profile.h" |
| 25 #include "chrome/browser/profiles/profile_impl.h" | 24 #include "chrome/browser/profiles/profile_impl.h" |
| 26 #include "chrome/browser/signin/signin_promo.h" | 25 #include "chrome/browser/signin/signin_promo.h" |
| 27 #include "chrome/browser/ui/browser.h" | 26 #include "chrome/browser/ui/browser.h" |
| 28 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 27 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 29 #include "chrome/browser/ui/zoom/chrome_zoom_level_prefs.h" | 28 #include "chrome/browser/ui/zoom/chrome_zoom_level_prefs.h" |
| 30 #include "chrome/common/chrome_constants.h" | 29 #include "chrome/common/chrome_constants.h" |
| 31 #include "chrome/common/chrome_paths.h" | 30 #include "chrome/common/chrome_paths.h" |
| 32 #include "chrome/common/pref_names.h" | 31 #include "chrome/common/pref_names.h" |
| 33 #include "chrome/common/url_constants.h" | 32 #include "chrome/common/url_constants.h" |
| 34 #include "chrome/test/base/in_process_browser_test.h" | 33 #include "chrome/test/base/in_process_browser_test.h" |
| 35 #include "chrome/test/base/testing_profile.h" | 34 #include "chrome/test/base/testing_profile.h" |
| 36 #include "chrome/test/base/ui_test_utils.h" | 35 #include "chrome/test/base/ui_test_utils.h" |
| 36 #include "components/prefs/pref_service.h" |
| 37 #include "components/signin/core/common/profile_management_switches.h" | 37 #include "components/signin/core/common/profile_management_switches.h" |
| 38 #include "components/signin/core/common/signin_switches.h" | 38 #include "components/signin/core/common/signin_switches.h" |
| 39 #include "components/ui/zoom/page_zoom.h" | 39 #include "components/ui/zoom/page_zoom.h" |
| 40 #include "components/ui/zoom/zoom_event_manager.h" | 40 #include "components/ui/zoom/zoom_event_manager.h" |
| 41 #include "content/public/test/test_utils.h" | 41 #include "content/public/test/test_utils.h" |
| 42 #include "net/dns/mock_host_resolver.h" | 42 #include "net/dns/mock_host_resolver.h" |
| 43 #include "net/test/embedded_test_server/embedded_test_server.h" | 43 #include "net/test/embedded_test_server/embedded_test_server.h" |
| 44 #include "net/test/embedded_test_server/http_response.h" | 44 #include "net/test/embedded_test_server/http_response.h" |
| 45 #include "testing/gmock/include/gmock/gmock.h" | 45 #include "testing/gmock/include/gmock/gmock.h" |
| 46 #include "url/gurl.h" | 46 #include "url/gurl.h" |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 ZoomLevelChangeObserver observer(browser()->profile()); | 410 ZoomLevelChangeObserver observer(browser()->profile()); |
| 411 | 411 |
| 412 web_contents->SetPageScale(1.5); | 412 web_contents->SetPageScale(1.5); |
| 413 observer.BlockUntilZoomLevelForHostHasChanged(test_host); | 413 observer.BlockUntilZoomLevelForHostHasChanged(test_host); |
| 414 EXPECT_FALSE(content::HostZoomMap::PageScaleFactorIsOne(web_contents)); | 414 EXPECT_FALSE(content::HostZoomMap::PageScaleFactorIsOne(web_contents)); |
| 415 | 415 |
| 416 web_contents->SetPageScale(1.f); | 416 web_contents->SetPageScale(1.f); |
| 417 observer.BlockUntilZoomLevelForHostHasChanged(test_host); | 417 observer.BlockUntilZoomLevelForHostHasChanged(test_host); |
| 418 EXPECT_TRUE(content::HostZoomMap::PageScaleFactorIsOne(web_contents)); | 418 EXPECT_TRUE(content::HostZoomMap::PageScaleFactorIsOne(web_contents)); |
| 419 } | 419 } |
| OLD | NEW |