OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/files/file_util.h" | 7 #include "base/files/file_util.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 // Expected results. | 165 // Expected results. |
166 bool should_allow_main_frame_load; | 166 bool should_allow_main_frame_load; |
167 bool should_allow_sub_frame_load; | 167 bool should_allow_sub_frame_load; |
168 } cases[] = { | 168 } cases[] = { |
169 {"spanning disabled", false, false, false, false}, | 169 {"spanning disabled", false, false, false, false}, |
170 {"split disabled", true, false, false, false}, | 170 {"split disabled", true, false, false, false}, |
171 {"spanning enabled", false, true, false, true}, | 171 {"spanning enabled", false, true, false, true}, |
172 {"split enabled", true, true, true, true}, | 172 {"split enabled", true, true, true, true}, |
173 }; | 173 }; |
174 | 174 |
175 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(cases); ++i) { | 175 for (size_t i = 0; i < arraysize(cases); ++i) { |
176 scoped_refptr<Extension> extension = | 176 scoped_refptr<Extension> extension = |
177 CreateTestExtension(cases[i].name, cases[i].incognito_split_mode); | 177 CreateTestExtension(cases[i].name, cases[i].incognito_split_mode); |
178 extension_info_map_->AddExtension( | 178 extension_info_map_->AddExtension( |
179 extension.get(), base::Time::Now(), cases[i].incognito_enabled, false); | 179 extension.get(), base::Time::Now(), cases[i].incognito_enabled, false); |
180 | 180 |
181 // First test a main frame request. | 181 // First test a main frame request. |
182 { | 182 { |
183 // It doesn't matter that the resource doesn't exist. If the resource | 183 // It doesn't matter that the resource doesn't exist. If the resource |
184 // is blocked, we should see ADDRESS_UNREACHABLE. Otherwise, the request | 184 // is blocked, we should see ADDRESS_UNREACHABLE. Otherwise, the request |
185 // should just fail because the file doesn't exist. | 185 // should just fail because the file doesn't exist. |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 extension->GetResourceURL("test.dat"), | 355 extension->GetResourceURL("test.dat"), |
356 net::DEFAULT_PRIORITY, | 356 net::DEFAULT_PRIORITY, |
357 &test_delegate_, | 357 &test_delegate_, |
358 NULL)); | 358 NULL)); |
359 StartRequest(request.get(), content::RESOURCE_TYPE_MEDIA); | 359 StartRequest(request.get(), content::RESOURCE_TYPE_MEDIA); |
360 EXPECT_EQ(net::URLRequestStatus::FAILED, request->status().status()); | 360 EXPECT_EQ(net::URLRequestStatus::FAILED, request->status().status()); |
361 } | 361 } |
362 } | 362 } |
363 | 363 |
364 } // namespace extensions | 364 } // namespace extensions |
OLD | NEW |