| OLD | NEW |
| 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 "content/test/unittest_test_suite.h" | 5 #include "content/test/unittest_test_suite.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/test/test_suite.h" | 8 #include "base/test/test_suite.h" |
| 9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" | 9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" |
| 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKitPlatformSupport
.h" | 10 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebKitPlatfo
rmSupport.h" |
| 11 | 11 |
| 12 // A stubbed out WebKit platform support impl. | 12 // A stubbed out WebKit platform support impl. |
| 13 class UnitTestTestSuite::UnitTestWebKitPlatformSupport | 13 class UnitTestTestSuite::UnitTestWebKitPlatformSupport |
| 14 : public WebKit::WebKitPlatformSupport { | 14 : public WebKit::WebKitPlatformSupport { |
| 15 public: | 15 public: |
| 16 UnitTestWebKitPlatformSupport() {} | 16 UnitTestWebKitPlatformSupport() {} |
| 17 virtual ~UnitTestWebKitPlatformSupport() {} | 17 virtual ~UnitTestWebKitPlatformSupport() {} |
| 18 virtual void cryptographicallyRandomValues(unsigned char* buffer, | 18 virtual void cryptographicallyRandomValues(unsigned char* buffer, |
| 19 size_t length) OVERRIDE { | 19 size_t length) OVERRIDE { |
| 20 memset(buffer, 0, length); | 20 memset(buffer, 0, length); |
| 21 } | 21 } |
| 22 }; | 22 }; |
| 23 | 23 |
| 24 UnitTestTestSuite::UnitTestTestSuite(base::TestSuite* test_suite) | 24 UnitTestTestSuite::UnitTestTestSuite(base::TestSuite* test_suite) |
| 25 : test_suite_(test_suite) { | 25 : test_suite_(test_suite) { |
| 26 DCHECK(test_suite); | 26 DCHECK(test_suite); |
| 27 webkit_platform_support_.reset(new UnitTestWebKitPlatformSupport); | 27 webkit_platform_support_.reset(new UnitTestWebKitPlatformSupport); |
| 28 WebKit::initialize(webkit_platform_support_.get()); | 28 WebKit::initialize(webkit_platform_support_.get()); |
| 29 } | 29 } |
| 30 | 30 |
| 31 UnitTestTestSuite::~UnitTestTestSuite() { | 31 UnitTestTestSuite::~UnitTestTestSuite() { |
| 32 WebKit::shutdown(); | 32 WebKit::shutdown(); |
| 33 } | 33 } |
| 34 | 34 |
| 35 int UnitTestTestSuite::Run() { | 35 int UnitTestTestSuite::Run() { |
| 36 return test_suite_->Run(); | 36 return test_suite_->Run(); |
| 37 } | 37 } |
| OLD | NEW |