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

Unified Diff: ui/views/test/views_test_base.cc

Issue 851853002: It is time. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Trying to reup because the last upload failed. Created 5 years, 11 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 | « ui/views/test/views_test_base.h ('k') | ui/views/test/views_test_helper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/test/views_test_base.cc
diff --git a/ui/views/test/views_test_base.cc b/ui/views/test/views_test_base.cc
deleted file mode 100644
index ade40e8175efc275d4193f0fe0d159e4a8be7cb4..0000000000000000000000000000000000000000
--- a/ui/views/test/views_test_base.cc
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright (c) 2012 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 "ui/views/test/views_test_base.h"
-
-#include "base/run_loop.h"
-#include "ui/base/clipboard/clipboard.h"
-#include "ui/base/ime/input_method_initializer.h"
-#include "ui/compositor/test/context_factories_for_test.h"
-#include "ui/views/test/views_test_helper.h"
-
-namespace views {
-
-ViewsTestBase::ViewsTestBase()
- : setup_called_(false),
- teardown_called_(false) {
-}
-
-ViewsTestBase::~ViewsTestBase() {
- CHECK(setup_called_)
- << "You have overridden SetUp but never called super class's SetUp";
- CHECK(teardown_called_)
- << "You have overridden TearDown but never called super class's TearDown";
-}
-
-void ViewsTestBase::SetUp() {
- testing::Test::SetUp();
- setup_called_ = true;
- if (!views_delegate_.get())
- views_delegate_.reset(new TestViewsDelegate());
- // The ContextFactory must exist before any Compositors are created.
- bool enable_pixel_output = false;
- ui::ContextFactory* context_factory =
- ui::InitializeContextFactoryForTests(enable_pixel_output);
-
- test_helper_.reset(ViewsTestHelper::Create(&message_loop_, context_factory));
- test_helper_->SetUp();
- ui::InitializeInputMethodForTesting();
-}
-
-void ViewsTestBase::TearDown() {
- ui::Clipboard::DestroyClipboardForCurrentThread();
-
- // Flush the message loop because we have pending release tasks
- // and these tasks if un-executed would upset Valgrind.
- RunPendingMessages();
- teardown_called_ = true;
- views_delegate_.reset();
- testing::Test::TearDown();
- ui::ShutdownInputMethodForTesting();
- test_helper_->TearDown();
- ui::TerminateContextFactoryForTests();
-}
-
-void ViewsTestBase::RunPendingMessages() {
- base::RunLoop run_loop;
- run_loop.RunUntilIdle();
-}
-
-Widget::InitParams ViewsTestBase::CreateParams(
- Widget::InitParams::Type type) {
- Widget::InitParams params(type);
- params.context = GetContext();
- return params;
-}
-
-gfx::NativeWindow ViewsTestBase::GetContext() {
- return test_helper_->GetContext();
-}
-
-} // namespace views
« no previous file with comments | « ui/views/test/views_test_base.h ('k') | ui/views/test/views_test_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698