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

Unified Diff: chrome/browser/net/client_hints_unittest.cc

Issue 948843003: Removed partial Client Hints implementation from the Chrome side. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 | « chrome/browser/net/client_hints.cc ('k') | chrome/browser/profiles/profile_io_data.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/client_hints_unittest.cc
diff --git a/chrome/browser/net/client_hints_unittest.cc b/chrome/browser/net/client_hints_unittest.cc
deleted file mode 100644
index d64fe53add184c4bdf3522465dfd33e76ca97a62..0000000000000000000000000000000000000000
--- a/chrome/browser/net/client_hints_unittest.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/net/client_hints.h"
-
-#include <locale.h>
-
-#include "base/logging.h"
-#if defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_IOS)
-#include "base/test/scoped_locale.h"
-#endif
-#include "testing/gtest/include/gtest/gtest.h"
-
-class ClientHintsTest : public testing::Test {
- public:
- void UpdateScreenInfo(float pixel_ratio) {
- client_hints_.UpdateScreenInfo(pixel_ratio);
- };
-
- protected:
- ClientHints client_hints_;
-};
-
-TEST_F(ClientHintsTest, HintsWellFormatted) {
- UpdateScreenInfo(1.567f);
- std::string hint = client_hints_.GetDevicePixelRatioHeader();
- EXPECT_EQ("1.57", hint);
-}
-
-// Android and iOS do not support setLocale.
-#if defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_IOS)
-// TODO(bengr): Use ScopedLocal in Windows once it is supported.
-TEST_F(ClientHintsTest, HintsWellFormattedWithNonEnLocale) {
- base::ScopedLocale locale("fr_FR.UTF-8");
- UpdateScreenInfo(1.567f);
- std::string hint = client_hints_.GetDevicePixelRatioHeader();
- EXPECT_EQ("1.57", hint);
-}
-#endif // defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_IOS)
-
-TEST_F(ClientHintsTest, HintsHaveNonbogusValues) {
- UpdateScreenInfo(-1.567f);
- std::string hint = client_hints_.GetDevicePixelRatioHeader();
- EXPECT_EQ("", hint);
-
- UpdateScreenInfo(1.567f);
- hint = client_hints_.GetDevicePixelRatioHeader();
- EXPECT_EQ("1.57", hint);
-
- UpdateScreenInfo(0.0f);
- hint = client_hints_.GetDevicePixelRatioHeader();
- // Hints should be last known good values.
- EXPECT_EQ("1.57", hint);
-}
-
« no previous file with comments | « chrome/browser/net/client_hints.cc ('k') | chrome/browser/profiles/profile_io_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698