Chromium Code Reviews| Index: chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_unittest.cc |
| diff --git a/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_unittest.cc b/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_unittest.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a5a75b44b53387c784b543ae2a9d3eab8b31549f |
| --- /dev/null |
| +++ b/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_unittest.cc |
| @@ -0,0 +1,37 @@ |
| +// Copyright 2014 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/spdyproxy/data_reduction_proxy_chrome_settings.h" |
| + |
| +#include "testing/gtest/include/gtest/gtest.h" |
| + |
| +const char kVersion[] = "1.2.3.4"; |
| +const char kBogusVersion[] = "0.0"; |
| +const char kExpectedBuild[] = "3"; |
| +const char kExpectedPatch[] = "4"; |
| + |
| +class DataReductionProxyChromeSettingsTest : public testing::Test { |
| + public: |
| + DataReductionProxyChromeSettingsTest() {} |
| +}; |
| + |
| +TEST_F(DataReductionProxyChromeSettingsTest, TestGetBuildNumber) { |
| + std::string build = |
| + DataReductionProxyChromeSettings::GetBuildNumberFromString(kVersion); |
| + EXPECT_EQ(kExpectedBuild, build); |
| + |
| + build = |
| + DataReductionProxyChromeSettings::GetBuildNumberFromString(kBogusVersion); |
| + EXPECT_EQ(std::string(), build); |
| +} |
| + |
| +TEST_F(DataReductionProxyChromeSettingsTest, TestGetPatchNumber) { |
| + std::string patch = |
| + DataReductionProxyChromeSettings::GetPatchNumberFromString(kVersion); |
|
bengr
2014/09/03 22:28:39
Fix these tests to reflect the new impl.
|
| + EXPECT_EQ(kExpectedPatch, patch); |
| + |
| + patch = |
| + DataReductionProxyChromeSettings::GetPatchNumberFromString(kBogusVersion); |
| + EXPECT_EQ(std::string(), patch); |
| +} |