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

Unified Diff: content/public/test/unittest_test_suite.cc

Issue 287043002: Use real PlatformSupport in content unit tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move suppressions to _mac.txt Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/test/unittest_test_suite.h ('k') | tools/valgrind/memcheck/suppressions_mac.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/test/unittest_test_suite.cc
diff --git a/content/public/test/unittest_test_suite.cc b/content/public/test/unittest_test_suite.cc
index 934eb44b860c28c020ede27b3efbd746b045bec3..67f3bb4b72f5102814c265db0c5ba0b5be7b117d 100644
--- a/content/public/test/unittest_test_suite.cc
+++ b/content/public/test/unittest_test_suite.cc
@@ -7,43 +7,24 @@
#include "base/logging.h"
#include "base/rand_util.h"
#include "base/test/test_suite.h"
-#include "third_party/WebKit/public/platform/Platform.h"
+#if !defined(OS_IOS)
+#include "content/test/test_webkit_platform_support.h"
+#endif
#include "third_party/WebKit/public/web/WebKit.h"
namespace content {
-#if !defined(OS_IOS)
-// A stubbed out WebKit platform support impl.
-class UnitTestTestSuite::UnitTestWebKitPlatformSupport
- : public blink::Platform {
- public:
- UnitTestWebKitPlatformSupport() {}
- virtual ~UnitTestWebKitPlatformSupport() {}
- virtual void cryptographicallyRandomValues(unsigned char* buffer,
- size_t length) OVERRIDE {
- base::RandBytes(buffer, length);
- }
- virtual const unsigned char* getTraceCategoryEnabledFlag(
- const char* categoryName) {
- // Causes tracing macros to be disabled.
- static const unsigned char kEnabled = 0;
- return &kEnabled;
- }
-};
-#endif // !OS_IOS
-
UnitTestTestSuite::UnitTestTestSuite(base::TestSuite* test_suite)
: test_suite_(test_suite) {
DCHECK(test_suite);
#if !defined(OS_IOS)
- webkit_platform_support_.reset(new UnitTestWebKitPlatformSupport);
- blink::initialize(webkit_platform_support_.get());
+ platform_support_.reset(new TestWebKitPlatformSupport);
#endif
}
UnitTestTestSuite::~UnitTestTestSuite() {
#if !defined(OS_IOS)
- blink::shutdown();
+ platform_support_.reset();
#endif
}
« no previous file with comments | « content/public/test/unittest_test_suite.h ('k') | tools/valgrind/memcheck/suppressions_mac.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698