Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Side by Side Diff: content/browser/loader/mime_type_resource_handler_unittest.cc

Issue 1515703005: WebRequest API: add more resource types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
Charlie Reis 2015/12/14 20:53:23 nit: Plugin
robwu 2015/12/15 13:17:25 Done.
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698