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 "content/browser/loader/mime_type_resource_handler.h" | 5 #include "content/browser/loader/mime_type_resource_handler.h" |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 TestStreamIsIntercepted(allow_download, must_download, resource_type)); | 311 TestStreamIsIntercepted(allow_download, must_download, resource_type)); |
312 | 312 |
313 // Sub-resource request with download not allowed. Stream shouldn't be | 313 // Sub-resource request with download not allowed. Stream shouldn't be |
314 // intercepted. | 314 // intercepted. |
315 allow_download = false; | 315 allow_download = false; |
316 must_download = false; | 316 must_download = false; |
317 resource_type = RESOURCE_TYPE_SUB_RESOURCE; | 317 resource_type = RESOURCE_TYPE_SUB_RESOURCE; |
318 EXPECT_FALSE( | 318 EXPECT_FALSE( |
319 TestStreamIsIntercepted(allow_download, must_download, resource_type)); | 319 TestStreamIsIntercepted(allow_download, must_download, resource_type)); |
320 | 320 |
| 321 // Plugin resource request with download not allowed. Stream shouldn't be |
| 322 // intercepted. |
| 323 allow_download = false; |
| 324 must_download = false; |
| 325 resource_type = RESOURCE_TYPE_PLUGIN_RESOURCE; |
| 326 EXPECT_FALSE( |
| 327 TestStreamIsIntercepted(allow_download, must_download, resource_type)); |
| 328 |
321 // Object request with download not allowed. Stream should be intercepted. | 329 // Object request with download not allowed. Stream should be intercepted. |
322 allow_download = false; | 330 allow_download = false; |
323 must_download = false; | 331 must_download = false; |
324 resource_type = RESOURCE_TYPE_OBJECT; | 332 resource_type = RESOURCE_TYPE_OBJECT; |
325 EXPECT_TRUE( | 333 EXPECT_TRUE( |
326 TestStreamIsIntercepted(allow_download, must_download, resource_type)); | 334 TestStreamIsIntercepted(allow_download, must_download, resource_type)); |
327 | 335 |
328 // Test the cases where the stream isn't handled by MaybeInterceptAsStream | 336 // Test the cases where the stream isn't handled by MaybeInterceptAsStream |
329 // in the ResourceDispatcherHost. | 337 // in the ResourceDispatcherHost. |
330 set_stream_has_handler(false); | 338 set_stream_has_handler(false); |
(...skipping 28 matching lines...) Expand all Loading... |
359 must_download = false; | 367 must_download = false; |
360 resource_type = RESOURCE_TYPE_OBJECT; | 368 resource_type = RESOURCE_TYPE_OBJECT; |
361 EXPECT_TRUE( | 369 EXPECT_TRUE( |
362 TestStreamIsIntercepted(allow_download, must_download, resource_type)); | 370 TestStreamIsIntercepted(allow_download, must_download, resource_type)); |
363 } | 371 } |
364 #endif | 372 #endif |
365 | 373 |
366 } // namespace | 374 } // namespace |
367 | 375 |
368 } // namespace content | 376 } // namespace content |
OLD | NEW |