diff options
author | jamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-07 21:28:49 +0000 |
---|---|---|
committer | jamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-07 21:28:49 +0000 |
commit | f971f9cabdcf9aaa46c12f598fa15241d2fa47cf (patch) | |
tree | 32ffcfaacd2ec52e67081e2032242578e698dabc /extensions/common/test_util.cc | |
parent | af01a3b5c3fe0471bde8425b618113ba5717853a (diff) | |
download | chromium_src-f971f9cabdcf9aaa46c12f598fa15241d2fa47cf.zip chromium_src-f971f9cabdcf9aaa46c12f598fa15241d2fa47cf.tar.gz chromium_src-f971f9cabdcf9aaa46c12f598fa15241d2fa47cf.tar.bz2 |
Create extensions_test_support build target
* Create extensions/common/test_util.h for shared test code
* Consolidate duplicated CreateExtensionWithID() functions
* Create extensions_test_support build target because you can't have multiple
files named test_util.h in a single build target on MSVS, all the other
names are taken (test_utils.h, extension_test_util.h, etc.), and this gets
us a step closer to having an extensions-only test suite.
* Fix some missing dependencies for the extensions_common target
* Remove unnecessary includes that create a dependency on themes
BUG=none
TEST=compiles, unit_tests
TBR=thakis@chromium.org for mechanical changes to chrome/browser/ui/cocoa/extensions/
Review URL: https://codereview.chromium.org/110463003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243382 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'extensions/common/test_util.cc')
-rw-r--r-- | extensions/common/test_util.cc | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/extensions/common/test_util.cc b/extensions/common/test_util.cc new file mode 100644 index 0000000..4d3164f --- /dev/null +++ b/extensions/common/test_util.cc @@ -0,0 +1,31 @@ +// Copyright 2014 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 "extensions/common/test_util.h" + +#include "extensions/common/extension.h" +#include "extensions/common/extension_builder.h" +#include "extensions/common/value_builder.h" + +namespace extensions { +namespace test_util { + +ExtensionBuilder& BuildExtension(ExtensionBuilder& builder) { + return builder + .SetManifest(DictionaryBuilder() + .Set("name", "Test extension") + .Set("version", "1.0") + .Set("manifest_version", 2)); +} + +scoped_refptr<Extension> CreateExtensionWithID(const std::string& id) { + return ExtensionBuilder() + .SetManifest( + DictionaryBuilder().Set("name", "test").Set("version", "0.1")) + .SetID(id) + .Build(); +} + +} // namespace test_util +} // namespace extensions |