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

Side by Side Diff: components/webcrypto/fuzzer_support.cc

Issue 2239563002: Remove remaining dependency on test_runner from components. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 4 years, 4 months 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
« no previous file with comments | « components/webcrypto/DEPS ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "components/webcrypto/fuzzer_support.h" 5 #include "components/webcrypto/fuzzer_support.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/numerics/safe_conversions.h" 9 #include "base/numerics/safe_conversions.h"
10 #include "components/test_runner/test_common.h"
11 #include "components/webcrypto/algorithm_dispatch.h" 10 #include "components/webcrypto/algorithm_dispatch.h"
12 #include "components/webcrypto/crypto_data.h" 11 #include "components/webcrypto/crypto_data.h"
13 #include "components/webcrypto/status.h" 12 #include "components/webcrypto/status.h"
13 #include "third_party/WebKit/public/platform/Platform.h"
14 #include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h" 14 #include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h"
15 #include "third_party/WebKit/public/web/WebKit.h"
15 16
16 namespace webcrypto { 17 namespace webcrypto {
17 18
18 namespace { 19 namespace {
19 20
20 // This mock is used to initialize blink. 21 // This mock is used to initialize blink.
21 class InitOnce { 22 class InitOnce : NON_EXPORTED_BASE(public blink::Platform) {
22 public: 23 public:
23 InitOnce() { 24 InitOnce() {
24 // EnsureBlinkInitialized() depends on the command line singleton being
25 // initialized.
26 base::CommandLine::Init(0, nullptr); 25 base::CommandLine::Init(0, nullptr);
27 test_runner::EnsureBlinkInitialized(); 26 blink::Platform::initialize(this);
28 } 27 }
28 ~InitOnce() override {}
29 }; 29 };
30 30
31 base::LazyInstance<InitOnce>::Leaky g_once = LAZY_INSTANCE_INITIALIZER; 31 base::LazyInstance<InitOnce>::Leaky g_once = LAZY_INSTANCE_INITIALIZER;
32 32
33 void EnsureInitialized() { 33 void EnsureInitialized() {
34 g_once.Get(); 34 g_once.Get();
35 } 35 }
36 36
37 blink::WebCryptoAlgorithm CreateRsaHashedImportAlgorithm( 37 blink::WebCryptoAlgorithm CreateRsaHashedImportAlgorithm(
38 blink::WebCryptoAlgorithmId id, 38 blink::WebCryptoAlgorithmId id,
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 123
124 // These errors imply a bad setup of parameters, and means ImportKey() may not 124 // These errors imply a bad setup of parameters, and means ImportKey() may not
125 // be testing the actual parsing. 125 // be testing the actual parsing.
126 DCHECK_NE(status.error_details(), 126 DCHECK_NE(status.error_details(),
127 Status::ErrorUnsupportedImportKeyFormat().error_details()); 127 Status::ErrorUnsupportedImportKeyFormat().error_details());
128 DCHECK_NE(status.error_details(), 128 DCHECK_NE(status.error_details(),
129 Status::ErrorCreateKeyBadUsages().error_details()); 129 Status::ErrorCreateKeyBadUsages().error_details());
130 } 130 }
131 131
132 } // namespace webcrypto 132 } // namespace webcrypto
OLDNEW
« no previous file with comments | « components/webcrypto/DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698