Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Unified Diff: components/ui/zoom/page_zoom_unittests.cc

Issue 847703003: Refactor to move chrome_page_zoom functions to components/ui/zoom. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Mac compile. Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/ui/zoom/page_zoom_constants.cc ('k') | components/ui_zoom.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ui/zoom/page_zoom_unittests.cc
diff --git a/chrome/browser/chrome_page_zoom_unittest.cc b/components/ui/zoom/page_zoom_unittests.cc
similarity index 80%
rename from chrome/browser/chrome_page_zoom_unittest.cc
rename to components/ui/zoom/page_zoom_unittests.cc
index 5784819a9e3edeab5849eefd360a73dbfe05e38c..94c4dddfd12e75182e8ca2fe3ebaa56c09e36595 100644
--- a/chrome/browser/chrome_page_zoom_unittest.cc
+++ b/components/ui/zoom/page_zoom_unittests.cc
@@ -2,16 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/chrome_page_zoom.h"
+#include "components/ui/zoom/page_zoom.h"
#include "content/public/common/page_zoom.h"
#include "testing/gtest/include/gtest/gtest.h"
-TEST(ChromePageZoomTest, PresetZoomFactors) {
+TEST(PageTestZoom, PresetZoomFactors) {
// Fetch a vector of preset zoom factors, including a custom value that we
// already know is not going to be in the list.
double custom_value = 1.05; // 105%
std::vector<double> factors =
- chrome_page_zoom::PresetZoomFactors(custom_value);
+ ui_zoom::PageZoom::PresetZoomFactors(custom_value);
// Expect at least 10 zoom factors.
EXPECT_GE(factors.size(), 10U);
@@ -43,11 +43,12 @@ TEST(ChromePageZoomTest, PresetZoomFactors) {
EXPECT_TRUE(found_100_percent);
}
-TEST(ChromePageZoomTest, PresetZoomLevels) {
+TEST(PageTestZoom, PresetZoomLevels) {
// Fetch a vector of preset zoom levels, including a custom value that we
// already know is not going to be in the list.
double custom_value = 0.1;
- std::vector<double> levels = chrome_page_zoom::PresetZoomLevels(custom_value);
+ std::vector<double> levels =
+ ui_zoom::PageZoom::PresetZoomLevels(custom_value);
// Expect at least 10 zoom levels.
EXPECT_GE(levels.size(), 10U);
@@ -75,23 +76,23 @@ TEST(ChromePageZoomTest, PresetZoomLevels) {
EXPECT_TRUE(found_100_percent);
}
-TEST(ChromePageZoomTest, InvalidCustomFactor) {
+TEST(PageTestZoom, InvalidCustomFactor) {
double too_low = 0.01;
- std::vector<double> factors = chrome_page_zoom::PresetZoomFactors(too_low);
+ std::vector<double> factors = ui_zoom::PageZoom::PresetZoomFactors(too_low);
EXPECT_FALSE(content::ZoomValuesEqual(factors.front(), too_low));
double too_high = 99.0;
- factors = chrome_page_zoom::PresetZoomFactors(too_high);
+ factors = ui_zoom::PageZoom::PresetZoomFactors(too_high);
EXPECT_FALSE(content::ZoomValuesEqual(factors.back(), too_high));
}
-TEST(ChromePageZoomTest, InvalidCustomLevel) {
+TEST(PageTestZoom, InvalidCustomLevel) {
double too_low = -99.0;
- std::vector<double> levels = chrome_page_zoom::PresetZoomLevels(too_low);
+ std::vector<double> levels = ui_zoom::PageZoom::PresetZoomLevels(too_low);
EXPECT_FALSE(content::ZoomValuesEqual(levels.front(), too_low));
double too_high = 99.0;
- levels = chrome_page_zoom::PresetZoomLevels(too_high);
+ levels = ui_zoom::PageZoom::PresetZoomLevels(too_high);
EXPECT_FALSE(content::ZoomValuesEqual(levels.back(), too_high));
}
« no previous file with comments | « components/ui/zoom/page_zoom_constants.cc ('k') | components/ui_zoom.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698