Commit 64e01b98 authored by lof84's avatar lof84 Committed by Commit bot

Use CCBlinkTestSuite for cc_blink_unittests

This CL fixes
WebLayerImplFixedBoundsTest.CompareToWebLayerImplComplex and
WebLayerImplFixedBoundsTest.CompareToWebLayerImplSimple tests.

BUG=440441

R=enne, danakj

Review URL: https://codereview.chromium.org/1130123005

Cr-Commit-Position: refs/heads/master@{#330167}
parent 34ec7ca7
......@@ -78,11 +78,15 @@ if (!is_mac) {
"web_animation_unittest.cc",
"web_float_animation_curve_unittest.cc",
"web_layer_impl_fixed_bounds_unittest.cc",
# Setup.
"test/cc_blink_test_suite.cc",
"test/run_all_unittests.cc",
]
deps = [
":blink",
"//base/test:run_all_unittests",
"//base/test:test_support",
"//base/third_party/dynamic_annotations",
"//skia",
"//testing/gtest",
......
......@@ -20,7 +20,8 @@
'cc_blink.gyp:cc_blink',
],
'sources': [
'../../base/test/run_all_unittests.cc',
'test/cc_blink_test_suite.cc',
'test/run_all_unittests.cc',
'web_animation_unittest.cc',
'web_float_animation_curve_unittest.cc',
'web_layer_impl_fixed_bounds_unittest.cc',
......
// Copyright (c) 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "cc/blink/test/cc_blink_test_suite.h"
#include "base/message_loop/message_loop.h"
#include "base/threading/thread_id_name_manager.h"
namespace cc_blink {
CCBlinkTestSuite::CCBlinkTestSuite(int argc, char** argv)
: base::TestSuite(argc, argv) {}
CCBlinkTestSuite::~CCBlinkTestSuite() {}
void CCBlinkTestSuite::Initialize() {
base::TestSuite::Initialize();
message_loop_.reset(new base::MessageLoop);
base::ThreadIdNameManager::GetInstance()->SetName(
base::PlatformThread::CurrentId(),
"Main");
}
void CCBlinkTestSuite::Shutdown() {
message_loop_ = nullptr;
base::TestSuite::Shutdown();
}
} // namespace cc_blink
// Copyright (c) 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CC_BLINK_TEST_CC_BLINK_TEST_SUITE_H_
#define CC_BLINK_TEST_CC_BLINK_TEST_SUITE_H_
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/test/test_suite.h"
namespace base {
class MessageLoop;
}
namespace cc_blink {
class CCBlinkTestSuite : public base::TestSuite {
public:
CCBlinkTestSuite(int argc, char** argv);
~CCBlinkTestSuite() override;
protected:
// Overridden from base::TestSuite:
void Initialize() override;
void Shutdown() override;
private:
scoped_ptr<base::MessageLoop> message_loop_;
DISALLOW_COPY_AND_ASSIGN(CCBlinkTestSuite);
};
} // namespace cc_blink
#endif // CC_BLINK_TEST_CC_BLINK_TEST_SUITE_H_
// Copyright (c) 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/bind.h"
#include "base/test/launcher/unit_test_launcher.h"
#include "cc/blink/test/cc_blink_test_suite.h"
int main(int argc, char** argv) {
cc_blink::CCBlinkTestSuite test_suite(argc, argv);
return base::LaunchUnitTests(
argc,
argv,
base::Bind(&cc_blink::CCBlinkTestSuite::Run,
base::Unretained(&test_suite)));
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment