OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "chrome/browser/net/client_hints.h" | |
6 | |
7 #include "base/logging.h" | |
8 #include "base/memory/scoped_ptr.h" | |
9 #include "testing/gtest/include/gtest/gtest.h" | |
10 | |
11 class ClientHintsTest : public testing::Test { | |
12 protected: | |
13 ClientHintsTest() {} | |
14 | |
15 virtual void SetUp() OVERRIDE { | |
Ryan Sleevi
2013/02/26 02:21:04
1) No need to use OVERRIDE for testing::Test overr
bengr
2013/02/26 18:19:53
Done.
| |
16 client_hints_ = new ClientHints(); | |
17 ClientHints::ScreenInfo info; | |
18 info.width = 100; | |
19 info.height = 200; | |
20 info.pixel_ratio = 1.567; | |
21 client_hints_->UpdateScreenInfo(&info); | |
22 } | |
23 | |
24 virtual void TearDown() OVERRIDE { | |
25 client_hints_ = NULL; | |
26 } | |
27 | |
28 scoped_refptr<ClientHints> client_hints_; | |
29 }; | |
30 | |
31 TEST_F(ClientHintsTest, HintsWellFormatted) { | |
Ryan Sleevi
2013/02/26 02:21:04
Are there any other edge cases you can be testing
bengr
2013/02/26 18:19:53
Not really. These values should be positive. I sup
| |
32 std::string hint = client_hints_->GetScreenInfoHints(); | |
33 EXPECT_EQ("dh=200, dw=100, dpr=1.57", hint); | |
34 } | |
35 | |
OLD | NEW |