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

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

Issue 7541001: Move more files from chrome/test to chrome/test/base, part #3 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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 | Annotate | Revision Log
« no previous file with comments | « chrome/test/unit/chrome_test_suite.cc ('k') | chrome/test/unit/win/rundebug.bat » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/test/unit/chrome_test_suite.h"
6 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h"
7 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKitClient.h"
8
9 namespace {
10
11 // A stubbed out webkit client impl.
12 class UnitTestWebKitClient : public WebKit::WebKitClient {
13 public:
14 UnitTestWebKitClient() {
15 }
16
17 virtual void cryptographicallyRandomValues(
18 unsigned char* buffer, size_t length) {
19 memset(buffer, 0, length);
20 }
21 };
22
23 // A special test suite that also initializes webkit once for all unittests.
24 // This is useful for two reasons:
25 // 1. It allows the use of some primitive webkit data types like WebString.
26 // 2. Individual unittests should not be initting webkit on their own, initting
27 // it here ensures attempts to do so within an individual test will fail.
28 class UnitTestTestSuite : public ChromeTestSuite {
29 public:
30 UnitTestTestSuite(int argc, char** argv)
31 : ChromeTestSuite(argc, argv) {
32 }
33
34 protected:
35 virtual void Initialize() {
36 WebKit::initialize(&webkitclient_);
37 ChromeTestSuite::Initialize();
38 }
39 virtual void Shutdown() {
40 ChromeTestSuite::Shutdown();
41 WebKit::shutdown();
42 }
43
44 UnitTestWebKitClient webkitclient_;
45 };
46
47 } // namespace
48
49 int main(int argc, char **argv) {
50 return UnitTestTestSuite(argc, argv).Run();
51 }
OLDNEW
« no previous file with comments | « chrome/test/unit/chrome_test_suite.cc ('k') | chrome/test/unit/win/rundebug.bat » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698