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

Unified Diff: chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_unittest.cc

Issue 530153002: Add build and patch to Chrome-Proxy header (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: using "" instead of string Created 6 years, 3 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
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);
+}

Powered by Google App Engine
This is Rietveld 408576698