diff options
author | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-16 18:26:58 +0000 |
---|---|---|
committer | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-16 18:26:58 +0000 |
commit | 175cd9dcb2b0b9fab4b03eca7051a39192306294 (patch) | |
tree | 0e07dc2cf52f1fd9eda1ddf34eb6a28d4776653b /content/test/webkit_unit_test_support.cc | |
parent | 607d01f2bc13732c9013cb08ce795e5ff94ee75e (diff) | |
download | chromium_src-175cd9dcb2b0b9fab4b03eca7051a39192306294.zip chromium_src-175cd9dcb2b0b9fab4b03eca7051a39192306294.tar.gz chromium_src-175cd9dcb2b0b9fab4b03eca7051a39192306294.tar.bz2 |
Provide webkit_unit_test support code in content/test
The webkit_unit_tests executable contains C++ gtest-based tests for various parts
of code inside third_party/WebKit. Since the tests call code that is internal to
Blink and not exposed through the public API, the test code has to live inside the
blink repository. However, it's not possible to provide a test environment suitable
for running unit tests from inside the Blink repository as Blink depends on its
embedder to provide basic functionality like currentTime(). In every case except
for webkit_unit_tests, this functionality is provided by the content layer using
other chromium components like base/, net/, cc/, ui/base, etc.
Without this patch, webkit_unit_tests gains access to this functionality by linking
against the static webkit_support library and calling
webkit_support::SetUpTestEnvironmentForUnitTests() which provides the platform
implementation. The implementation of this lives in webkit/support/ and since content/
depends on webkit/, it's undesirable for this code to depend on content/. This means that
we have to keep a subset of the platform support code in webkit/ even when in production
it's only used by the content layer. Lots of code is awkwardly split between content/ and
webkit/ in order to satisfy this constraint.
This establishes a content_webkit_unit_test static library to provide this setup code so.
This is a static library that won't be linked into any production targets but that will
depend on content.
This is also unfortunate in that it it's a call directly from the Blink repository into
the Chromium repository sidestepping the public Blink API, but that's harder to fix.
NOTRY=true
R=darin
Review URL: https://chromiumcodereview.appspot.com/18739004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211817 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/test/webkit_unit_test_support.cc')
-rw-r--r-- | content/test/webkit_unit_test_support.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/content/test/webkit_unit_test_support.cc b/content/test/webkit_unit_test_support.cc new file mode 100644 index 0000000..bb617a8 --- /dev/null +++ b/content/test/webkit_unit_test_support.cc @@ -0,0 +1,19 @@ +// Copyright 2013 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 "content/test/webkit_unit_test_support.h" + +#include "webkit/support/webkit_support.h" + +namespace content { + +void SetUpTestEnvironmentForWebKitUnitTests() { + webkit_support::SetUpTestEnvironmentForUnitTests(); +} + +void TearDownEnvironmentForWebKitUnitTests() { + webkit_support::TearDownTestEnvironment(); +} + +} |