| OLD | NEW |
| 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 "sync/js/js_test_util.h" |
| 6 | 6 |
| 7 #include <memory> |
| 8 |
| 7 #include "base/macros.h" | 9 #include "base/macros.h" |
| 8 #include "base/memory/scoped_ptr.h" | |
| 9 #include "sync/js/js_event_details.h" | 10 #include "sync/js/js_event_details.h" |
| 10 | 11 |
| 11 namespace syncer { | 12 namespace syncer { |
| 12 | 13 |
| 13 void PrintTo(const JsEventDetails& details, ::std::ostream* os) { | 14 void PrintTo(const JsEventDetails& details, ::std::ostream* os) { |
| 14 *os << details.ToString(); | 15 *os << details.ToString(); |
| 15 } | 16 } |
| 16 | 17 |
| 17 namespace { | 18 namespace { |
| 18 | 19 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 48 | 49 |
| 49 } // namespace | 50 } // namespace |
| 50 | 51 |
| 51 ::testing::Matcher<const JsEventDetails&> HasDetails( | 52 ::testing::Matcher<const JsEventDetails&> HasDetails( |
| 52 const JsEventDetails& expected_details) { | 53 const JsEventDetails& expected_details) { |
| 53 return ::testing::MakeMatcher(new HasDetailsMatcher(expected_details)); | 54 return ::testing::MakeMatcher(new HasDetailsMatcher(expected_details)); |
| 54 } | 55 } |
| 55 | 56 |
| 56 ::testing::Matcher<const JsEventDetails&> HasDetailsAsDictionary( | 57 ::testing::Matcher<const JsEventDetails&> HasDetailsAsDictionary( |
| 57 const base::DictionaryValue& expected_details) { | 58 const base::DictionaryValue& expected_details) { |
| 58 scoped_ptr<base::DictionaryValue> expected_details_copy( | 59 std::unique_ptr<base::DictionaryValue> expected_details_copy( |
| 59 expected_details.DeepCopy()); | 60 expected_details.DeepCopy()); |
| 60 return HasDetails(JsEventDetails(expected_details_copy.get())); | 61 return HasDetails(JsEventDetails(expected_details_copy.get())); |
| 61 } | 62 } |
| 62 | 63 |
| 63 MockJsBackend::MockJsBackend() {} | 64 MockJsBackend::MockJsBackend() {} |
| 64 | 65 |
| 65 MockJsBackend::~MockJsBackend() {} | 66 MockJsBackend::~MockJsBackend() {} |
| 66 | 67 |
| 67 WeakHandle<JsBackend> MockJsBackend::AsWeakHandle() { | 68 WeakHandle<JsBackend> MockJsBackend::AsWeakHandle() { |
| 68 return MakeWeakHandle(AsWeakPtr()); | 69 return MakeWeakHandle(AsWeakPtr()); |
| 69 } | 70 } |
| 70 | 71 |
| 71 MockJsController::MockJsController() {} | 72 MockJsController::MockJsController() {} |
| 72 | 73 |
| 73 MockJsController::~MockJsController() {} | 74 MockJsController::~MockJsController() {} |
| 74 | 75 |
| 75 MockJsEventHandler::MockJsEventHandler() {} | 76 MockJsEventHandler::MockJsEventHandler() {} |
| 76 | 77 |
| 77 WeakHandle<JsEventHandler> MockJsEventHandler::AsWeakHandle() { | 78 WeakHandle<JsEventHandler> MockJsEventHandler::AsWeakHandle() { |
| 78 return MakeWeakHandle(AsWeakPtr()); | 79 return MakeWeakHandle(AsWeakPtr()); |
| 79 } | 80 } |
| 80 | 81 |
| 81 MockJsEventHandler::~MockJsEventHandler() {} | 82 MockJsEventHandler::~MockJsEventHandler() {} |
| 82 | 83 |
| 83 } // namespace syncer | 84 } // namespace syncer |
| 84 | 85 |
| OLD | NEW |