• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2011 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 "net/base/ssl_config_service.h"
6 #include "testing/gtest/include/gtest/gtest.h"
7 
8 namespace {
9 
IsFalseStartIncompatible(const std::string & hostname)10 bool IsFalseStartIncompatible(const std::string& hostname) {
11   return net::SSLConfigService::IsKnownFalseStartIncompatibleServer(
12       hostname);
13 }
14 
15 }  // namespace
16 
TEST(SSLConfigServiceTest,FalseStartDisabledHosts)17 TEST(SSLConfigServiceTest, FalseStartDisabledHosts) {
18   EXPECT_TRUE(IsFalseStartIncompatible("www.picnik.com"));
19   EXPECT_FALSE(IsFalseStartIncompatible("picnikfoo.com"));
20   EXPECT_FALSE(IsFalseStartIncompatible("foopicnik.com"));
21 }
22 
TEST(SSLConfigServiceTest,FalseStartDisabledDomains)23 TEST(SSLConfigServiceTest, FalseStartDisabledDomains) {
24   EXPECT_TRUE(IsFalseStartIncompatible("yodlee.com"));
25   EXPECT_TRUE(IsFalseStartIncompatible("a.yodlee.com"));
26   EXPECT_TRUE(IsFalseStartIncompatible("b.a.yodlee.com"));
27   EXPECT_FALSE(IsFalseStartIncompatible("ayodlee.com"));
28   EXPECT_FALSE(IsFalseStartIncompatible("yodleea.com"));
29   EXPECT_FALSE(IsFalseStartIncompatible("yodlee.org"));
30 }
31