summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sync/js_test_util.cc
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-10 12:58:00 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-10 12:58:00 +0000
commit649840c77637f62d7a6a5decc079dcff46f8f342 (patch)
tree3d32d2c9da34de738d146b862de52c2cdecb05e5 /chrome/browser/sync/js_test_util.cc
parent95ba7ac458946bc8775939e2ac946a87200c82ab (diff)
downloadchromium_src-649840c77637f62d7a6a5decc079dcff46f8f342.zip
chromium_src-649840c77637f62d7a6a5decc079dcff46f8f342.tar.gz
chromium_src-649840c77637f62d7a6a5decc079dcff46f8f342.tar.bz2
sync: Move all the js_* files into a js/ subdirectory.
Note: This was a TODO for akalin. BUG=None TEST=None R=akalin@chromium.org Review URL: http://codereview.chromium.org/7497051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96169 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync/js_test_util.cc')
-rw-r--r--chrome/browser/sync/js_test_util.cc137
1 files changed, 0 insertions, 137 deletions
diff --git a/chrome/browser/sync/js_test_util.cc b/chrome/browser/sync/js_test_util.cc
deleted file mode 100644
index eea7576..0000000
--- a/chrome/browser/sync/js_test_util.cc
+++ /dev/null
@@ -1,137 +0,0 @@
-// Copyright (c) 2011 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 "chrome/browser/sync/js_test_util.h"
-
-#include "base/basictypes.h"
-#include "base/memory/scoped_ptr.h"
-#include "chrome/browser/sync/js_arg_list.h"
-#include "chrome/browser/sync/js_event_details.h"
-
-namespace browser_sync {
-
-void PrintTo(const JsArgList& args, ::std::ostream* os) {
- *os << args.ToString();
-}
-
-void PrintTo(const JsEventDetails& details, ::std::ostream* os) {
- *os << details.ToString();
-}
-
-namespace {
-
-// Matcher implementation for HasArgs().
-class HasArgsMatcher
- : public ::testing::MatcherInterface<const JsArgList&> {
- public:
- explicit HasArgsMatcher(const JsArgList& expected_args)
- : expected_args_(expected_args) {}
-
- virtual ~HasArgsMatcher() {}
-
- virtual bool MatchAndExplain(
- const JsArgList& args,
- ::testing::MatchResultListener* listener) const {
- // No need to annotate listener since we already define PrintTo().
- return args.Get().Equals(&expected_args_.Get());
- }
-
- virtual void DescribeTo(::std::ostream* os) const {
- *os << "has args " << expected_args_.ToString();
- }
-
- virtual void DescribeNegationTo(::std::ostream* os) const {
- *os << "doesn't have args " << expected_args_.ToString();
- }
-
- private:
- const JsArgList expected_args_;
-
- DISALLOW_COPY_AND_ASSIGN(HasArgsMatcher);
-};
-
-// Matcher implementation for HasDetails().
-class HasDetailsMatcher
- : public ::testing::MatcherInterface<const JsEventDetails&> {
- public:
- explicit HasDetailsMatcher(const JsEventDetails& expected_details)
- : expected_details_(expected_details) {}
-
- virtual ~HasDetailsMatcher() {}
-
- virtual bool MatchAndExplain(
- const JsEventDetails& details,
- ::testing::MatchResultListener* listener) const {
- // No need to annotate listener since we already define PrintTo().
- return details.Get().Equals(&expected_details_.Get());
- }
-
- virtual void DescribeTo(::std::ostream* os) const {
- *os << "has details " << expected_details_.ToString();
- }
-
- virtual void DescribeNegationTo(::std::ostream* os) const {
- *os << "doesn't have details " << expected_details_.ToString();
- }
-
- private:
- const JsEventDetails expected_details_;
-
- DISALLOW_COPY_AND_ASSIGN(HasDetailsMatcher);
-};
-
-} // namespace
-
-::testing::Matcher<const JsArgList&> HasArgs(const JsArgList& expected_args) {
- return ::testing::MakeMatcher(new HasArgsMatcher(expected_args));
-}
-
-::testing::Matcher<const JsArgList&> HasArgsAsList(
- const ListValue& expected_args) {
- scoped_ptr<ListValue> expected_args_copy(expected_args.DeepCopy());
- return HasArgs(JsArgList(expected_args_copy.get()));
-}
-
-::testing::Matcher<const JsEventDetails&> HasDetails(
- const JsEventDetails& expected_details) {
- return ::testing::MakeMatcher(new HasDetailsMatcher(expected_details));
-}
-
-::testing::Matcher<const JsEventDetails&> HasDetailsAsDictionary(
- const DictionaryValue& expected_details) {
- scoped_ptr<DictionaryValue> expected_details_copy(
- expected_details.DeepCopy());
- return HasDetails(JsEventDetails(expected_details_copy.get()));
-}
-
-MockJsBackend::MockJsBackend() {}
-
-MockJsBackend::~MockJsBackend() {}
-
-WeakHandle<JsBackend> MockJsBackend::AsWeakHandle() {
- return WeakHandle<JsBackend>(AsWeakPtr());
-}
-
-MockJsController::MockJsController() {}
-
-MockJsController::~MockJsController() {}
-
-MockJsEventHandler::MockJsEventHandler() {}
-
-WeakHandle<JsEventHandler> MockJsEventHandler::AsWeakHandle() {
- return WeakHandle<JsEventHandler>(AsWeakPtr());
-}
-
-MockJsEventHandler::~MockJsEventHandler() {}
-
-MockJsReplyHandler::MockJsReplyHandler() {}
-
-MockJsReplyHandler::~MockJsReplyHandler() {}
-
-WeakHandle<JsReplyHandler> MockJsReplyHandler::AsWeakHandle() {
- return WeakHandle<JsReplyHandler>(AsWeakPtr());
-}
-
-} // namespace browser_sync
-