Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / net / spdyproxy / data_reduction_proxy_chrome_configurator_unittest.cc
index a8ef6dc..06848fa 100644 (file)
@@ -9,6 +9,7 @@
 #include "base/memory/scoped_ptr.h"
 #include "base/prefs/pref_registry_simple.h"
 #include "base/prefs/testing_pref_service.h"
+#include "base/test/test_simple_task_runner.h"
 #include "base/values.h"
 #include "chrome/common/pref_names.h"
 #include "testing/gmock/include/gmock/gmock.h"
@@ -19,7 +20,9 @@ class DataReductionProxyConfigTest : public testing::Test {
   virtual void SetUp() {
     PrefRegistrySimple* registry = pref_service_.registry();
     registry->RegisterDictionaryPref(prefs::kProxy);
-    config_.reset(new DataReductionProxyChromeConfigurator(&pref_service_));
+    config_.reset(new DataReductionProxyChromeConfigurator(
+        &pref_service_,
+        new base::TestSimpleTaskRunner()));
   }
 
   void CheckProxyConfig(
@@ -48,19 +51,35 @@ TEST_F(DataReductionProxyConfigTest, TestUnrestricted) {
   config_->Enable(false,
                   false,
                   "https://www.foo.com:443/",
-                 "http://www.bar.com:80/");
+                  "http://www.bar.com:80/",
+                  "");
   CheckProxyConfig(
       "fixed_servers",
       "http=https://www.foo.com:443,http://www.bar.com:80,direct://;",
       "");
 }
+
+TEST_F(DataReductionProxyConfigTest, TestUnrestrictedSSL) {
+  config_->Enable(false,
+                  false,
+                  "https://www.foo.com:443/",
+                  "http://www.bar.com:80/",
+                  "http://www.ssl.com:80/");
+  CheckProxyConfig(
+      "fixed_servers",
+      "http=https://www.foo.com:443,http://www.bar.com:80,direct://;"
+      "https=http://www.ssl.com:80,direct://;",
+      "");
+}
+
 TEST_F(DataReductionProxyConfigTest, TestUnrestrictedWithBypassRule) {
   config_->AddHostPatternToBypass("<local>");
   config_->AddHostPatternToBypass("*.goo.com");
   config_->Enable(false,
                   false,
                   "https://www.foo.com:443/",
-                 "http://www.bar.com:80/");
+                  "http://www.bar.com:80/",
+                  "");
   CheckProxyConfig(
       "fixed_servers",
       "http=https://www.foo.com:443,http://www.bar.com:80,direct://;",
@@ -68,10 +87,7 @@ TEST_F(DataReductionProxyConfigTest, TestUnrestrictedWithBypassRule) {
 }
 
 TEST_F(DataReductionProxyConfigTest, TestUnrestrictedWithoutFallback) {
-  config_->Enable(false,
-                  false,
-                  "https://www.foo.com:443/",
-                  "");
+  config_->Enable(false, false, "https://www.foo.com:443/", "", "");
   CheckProxyConfig("fixed_servers",
                    "http=https://www.foo.com:443,direct://;",
                    "");
@@ -81,7 +97,8 @@ TEST_F(DataReductionProxyConfigTest, TestRestricted) {
   config_->Enable(true,
                   false,
                   "https://www.foo.com:443/",
-                 "http://www.bar.com:80/");
+                  "http://www.bar.com:80/",
+                  "");
   CheckProxyConfig("fixed_servers",
                    "http=http://www.bar.com:80,direct://;",
                    "");
@@ -91,7 +108,8 @@ TEST_F(DataReductionProxyConfigTest, TestFallbackRestricted) {
   config_->Enable(false,
                   true,
                   "https://www.foo.com:443/",
-                 "http://www.bar.com:80/");
+                  "http://www.bar.com:80/",
+                  "");
   CheckProxyConfig("fixed_servers",
                    "http=https://www.foo.com:443,direct://;",
                    "");
@@ -101,7 +119,8 @@ TEST_F(DataReductionProxyConfigTest, TestBothRestricted) {
   config_->Enable(true,
                   true,
                   "https://www.foo.com:443/",
-                 "http://www.bar.com:80/");
+                  "http://www.bar.com:80/",
+                  "");
   CheckProxyConfig("system", "", "");
 }