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

Side by Side Diff: components/sync/js/js_test_util.cc

Issue 2130453004: [Sync] Move //sync to //components/sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « components/sync/js/js_test_util.h ('k') | components/sync/js/sync_js_controller.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "sync/js/js_test_util.h" 5 #include "components/sync/js/js_test_util.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "sync/js/js_event_details.h" 10 #include "components/sync/js/js_event_details.h"
11 11
12 namespace syncer { 12 namespace syncer {
13 13
14 void PrintTo(const JsEventDetails& details, ::std::ostream* os) { 14 void PrintTo(const JsEventDetails& details, ::std::ostream* os) {
15 *os << details.ToString(); 15 *os << details.ToString();
16 } 16 }
17 17
18 namespace { 18 namespace {
19 19
20 // Matcher implementation for HasDetails(). 20 // Matcher implementation for HasDetails().
21 class HasDetailsMatcher 21 class HasDetailsMatcher
22 : public ::testing::MatcherInterface<const JsEventDetails&> { 22 : public ::testing::MatcherInterface<const JsEventDetails&> {
23 public: 23 public:
24 explicit HasDetailsMatcher(const JsEventDetails& expected_details) 24 explicit HasDetailsMatcher(const JsEventDetails& expected_details)
25 : expected_details_(expected_details) {} 25 : expected_details_(expected_details) {}
26 26
27 virtual ~HasDetailsMatcher() {} 27 virtual ~HasDetailsMatcher() {}
28 28
29 virtual bool MatchAndExplain( 29 virtual bool MatchAndExplain(const JsEventDetails& details,
30 const JsEventDetails& details, 30 ::testing::MatchResultListener* listener) const {
31 ::testing::MatchResultListener* listener) const {
32 // No need to annotate listener since we already define PrintTo(). 31 // No need to annotate listener since we already define PrintTo().
33 return details.Get().Equals(&expected_details_.Get()); 32 return details.Get().Equals(&expected_details_.Get());
34 } 33 }
35 34
36 virtual void DescribeTo(::std::ostream* os) const { 35 virtual void DescribeTo(::std::ostream* os) const {
37 *os << "has details " << expected_details_.ToString(); 36 *os << "has details " << expected_details_.ToString();
38 } 37 }
39 38
40 virtual void DescribeNegationTo(::std::ostream* os) const { 39 virtual void DescribeNegationTo(::std::ostream* os) const {
41 *os << "doesn't have details " << expected_details_.ToString(); 40 *os << "doesn't have details " << expected_details_.ToString();
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 74
76 MockJsEventHandler::MockJsEventHandler() {} 75 MockJsEventHandler::MockJsEventHandler() {}
77 76
78 WeakHandle<JsEventHandler> MockJsEventHandler::AsWeakHandle() { 77 WeakHandle<JsEventHandler> MockJsEventHandler::AsWeakHandle() {
79 return MakeWeakHandle(AsWeakPtr()); 78 return MakeWeakHandle(AsWeakPtr());
80 } 79 }
81 80
82 MockJsEventHandler::~MockJsEventHandler() {} 81 MockJsEventHandler::~MockJsEventHandler() {}
83 82
84 } // namespace syncer 83 } // namespace syncer
85
OLDNEW
« no previous file with comments | « components/sync/js/js_test_util.h ('k') | components/sync/js/sync_js_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698