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

Side by Side Diff: chrome/test/unit/run_all_unittests.cc

Issue 7461036: Expose a test cryptographicallyRandomValues to UnitTestWebKitClient. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/test/unit/chrome_test_suite.h" 5 #include "chrome/test/unit/chrome_test_suite.h"
6 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" 6 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h"
7 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKitClient.h" 7 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKitClient.h"
8 8
9 namespace { 9 namespace {
10 10
11 // A stubbed out webkit client impl. 11 // A stubbed out webkit client impl.
12 class UnitTestWebKitClient : public WebKit::WebKitClient { 12 class UnitTestWebKitClient : public WebKit::WebKitClient {
13 public: 13 public:
14 UnitTestWebKitClient() { 14 UnitTestWebKitClient() {
15 } 15 }
16
17 virtual void cryptographicallyRandomValues(
18 unsigned char* buffer, size_t length) {
19 memset(buffer, 0, length);
20 }
16 }; 21 };
17 22
18 // A special test suite that also initializes webkit once for all unittests. 23 // A special test suite that also initializes webkit once for all unittests.
19 // This is useful for two reasons: 24 // This is useful for two reasons:
20 // 1. It allows the use of some primitive webkit data types like WebString. 25 // 1. It allows the use of some primitive webkit data types like WebString.
21 // 2. Individual unittests should not be initting webkit on their own, initting 26 // 2. Individual unittests should not be initting webkit on their own, initting
22 // it here ensures attempts to do so within an individual test will fail. 27 // it here ensures attempts to do so within an individual test will fail.
23 class UnitTestTestSuite : public ChromeTestSuite { 28 class UnitTestTestSuite : public ChromeTestSuite {
24 public: 29 public:
25 UnitTestTestSuite(int argc, char** argv) 30 UnitTestTestSuite(int argc, char** argv)
(...skipping 11 matching lines...) Expand all
37 } 42 }
38 43
39 UnitTestWebKitClient webkitclient_; 44 UnitTestWebKitClient webkitclient_;
40 }; 45 };
41 46
42 } // namespace 47 } // namespace
43 48
44 int main(int argc, char **argv) { 49 int main(int argc, char **argv) {
45 return UnitTestTestSuite(argc, argv).Run(); 50 return UnitTestTestSuite(argc, argv).Run();
46 } 51 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698