OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/loader/offline_policy.h" | 5 #include "content/browser/loader/offline_policy.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "content/public/common/content_switches.h" | 8 #include "content/public/common/content_switches.h" |
9 #include "net/base/load_flags.h" | 9 #include "net/base/load_flags.h" |
10 #include "net/http/http_response_info.h" | 10 #include "net/http/http_response_info.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
12 #include "webkit/glue/resource_type.h" | 12 #include "webkit/common/resource_type.h" |
13 | 13 |
14 namespace content { | 14 namespace content { |
15 | 15 |
16 class OfflinePolicyTest : public testing::Test { | 16 class OfflinePolicyTest : public testing::Test { |
17 protected: | 17 protected: |
18 virtual void SetUp() { | 18 virtual void SetUp() { |
19 CommandLine::ForCurrentProcess()->AppendSwitch( | 19 CommandLine::ForCurrentProcess()->AppendSwitch( |
20 switches::kEnableOfflineCacheAccess); | 20 switches::kEnableOfflineCacheAccess); |
21 policy_ = new OfflinePolicy; | 21 policy_ = new OfflinePolicy; |
22 } | 22 } |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 // Cache related flags inhibit the returning of any special flags. | 87 // Cache related flags inhibit the returning of any special flags. |
88 TEST_F(OfflinePolicyTest, ConsumerFlagOverride) { | 88 TEST_F(OfflinePolicyTest, ConsumerFlagOverride) { |
89 EXPECT_EQ(0, policy_->GetAdditionalLoadFlags(net::LOAD_BYPASS_CACHE, true)); | 89 EXPECT_EQ(0, policy_->GetAdditionalLoadFlags(net::LOAD_BYPASS_CACHE, true)); |
90 net::HttpResponseInfo response_info; | 90 net::HttpResponseInfo response_info; |
91 response_info.server_data_unavailable = true; | 91 response_info.server_data_unavailable = true; |
92 policy_->UpdateStateForSuccessfullyStartedRequest(response_info); | 92 policy_->UpdateStateForSuccessfullyStartedRequest(response_info); |
93 EXPECT_EQ(0, policy_->GetAdditionalLoadFlags(net::LOAD_BYPASS_CACHE, false)); | 93 EXPECT_EQ(0, policy_->GetAdditionalLoadFlags(net::LOAD_BYPASS_CACHE, false)); |
94 } | 94 } |
95 | 95 |
96 } | 96 } |
OLD | NEW |