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

Side by Side Diff: chrome/browser/safe_browsing/incident_reporting/off_domain_inclusion_detector_unittest.cc

Issue 1515703005: WebRequest API: add more resource types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Replace == with && 2x 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/files/file_util.h" 6 #include "base/files/file_util.h"
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 96
97 const content::ResourceType kResourceTypesObservedIfInMainFrame[] = { 97 const content::ResourceType kResourceTypesObservedIfInMainFrame[] = {
98 content::RESOURCE_TYPE_STYLESHEET, 98 content::RESOURCE_TYPE_STYLESHEET,
99 content::RESOURCE_TYPE_SCRIPT, 99 content::RESOURCE_TYPE_SCRIPT,
100 content::RESOURCE_TYPE_IMAGE, 100 content::RESOURCE_TYPE_IMAGE,
101 content::RESOURCE_TYPE_FONT_RESOURCE, 101 content::RESOURCE_TYPE_FONT_RESOURCE,
102 content::RESOURCE_TYPE_SUB_RESOURCE, 102 content::RESOURCE_TYPE_SUB_RESOURCE,
103 content::RESOURCE_TYPE_OBJECT, 103 content::RESOURCE_TYPE_OBJECT,
104 content::RESOURCE_TYPE_MEDIA, 104 content::RESOURCE_TYPE_MEDIA,
105 content::RESOURCE_TYPE_XHR, 105 content::RESOURCE_TYPE_XHR,
106 content::RESOURCE_TYPE_PLUGIN_RESOURCE,
106 }; 107 };
107 108
108 const content::ResourceType kResourceTypesIgnored[] = { 109 const content::ResourceType kResourceTypesIgnored[] = {
109 content::RESOURCE_TYPE_MAIN_FRAME, 110 content::RESOURCE_TYPE_MAIN_FRAME,
110 content::RESOURCE_TYPE_WORKER, 111 content::RESOURCE_TYPE_WORKER,
111 content::RESOURCE_TYPE_SHARED_WORKER, 112 content::RESOURCE_TYPE_SHARED_WORKER,
112 content::RESOURCE_TYPE_PREFETCH, 113 content::RESOURCE_TYPE_PREFETCH,
113 content::RESOURCE_TYPE_FAVICON, 114 content::RESOURCE_TYPE_FAVICON,
114 content::RESOURCE_TYPE_PING, 115 content::RESOURCE_TYPE_PING,
115 content::RESOURCE_TYPE_SERVICE_WORKER, 116 content::RESOURCE_TYPE_SERVICE_WORKER,
117 content::RESOURCE_TYPE_CSP_REPORT,
116 }; 118 };
117 119
118 static_assert( 120 static_assert(
119 arraysize(kResourceTypesObservedIfParentIsMainFrame) + 121 arraysize(kResourceTypesObservedIfParentIsMainFrame) +
120 arraysize(kResourceTypesObservedIfInMainFrame) + 122 arraysize(kResourceTypesObservedIfInMainFrame) +
121 arraysize(kResourceTypesIgnored) == content::RESOURCE_TYPE_LAST_TYPE, 123 arraysize(kResourceTypesIgnored) == content::RESOURCE_TYPE_LAST_TYPE,
122 "Expected resource types list aren't comprehensive"); 124 "Expected resource types list aren't comprehensive");
123 125
124 // A set of test cases to run each parametrized test case below through. 126 // A set of test cases to run each parametrized test case below through.
125 enum class TestCase { 127 enum class TestCase {
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 } 595 }
594 596
595 INSTANTIATE_TEST_CASE_P(OffDomainInclusionDetectorTestInstance, 597 INSTANTIATE_TEST_CASE_P(OffDomainInclusionDetectorTestInstance,
596 OffDomainInclusionDetectorTest, 598 OffDomainInclusionDetectorTest,
597 Values(TestCase::WHITELISTED, 599 Values(TestCase::WHITELISTED,
598 TestCase::IN_HISTORY, 600 TestCase::IN_HISTORY,
599 TestCase::IN_HISTORY_AND_WHITELISTED, 601 TestCase::IN_HISTORY_AND_WHITELISTED,
600 TestCase::UNKNOWN)); 602 TestCase::UNKNOWN));
601 603
602 } // namespace safe_browsing 604 } // namespace safe_browsing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698