Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef BLIMP_CLIENT_CORE_CONTENTS_FAKE_NAVIGATION_FEATURE_H_ | |
| 6 #define BLIMP_CLIENT_CORE_CONTENTS_FAKE_NAVIGATION_FEATURE_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/memory/weak_ptr.h" | |
| 11 #include "blimp/client/core/contents/navigation_feature.h" | |
| 12 #include "testing/gmock/include/gmock/gmock.h" | |
| 13 | |
| 14 namespace blimp { | |
| 15 namespace client { | |
| 16 | |
| 17 class FakeNavigationFeature : public NavigationFeature { | |
|
Kevin M
2016/07/27 23:35:17
s/Fake/Mock/
shaktisahu
2016/07/28 19:32:52
The NavigateToUrlText method emulates that URL has
Kevin M
2016/07/29 21:05:32
We don't need to emulate that behavior, because it
shaktisahu
2016/07/29 22:57:30
hmm.. Emulating this method provides a nice way to
Kevin M
2016/08/01 23:41:57
Yeah, but right now a lot of the functionality of
| |
| 18 public: | |
| 19 FakeNavigationFeature(); | |
| 20 ~FakeNavigationFeature(); | |
| 21 | |
| 22 MOCK_METHOD1(Reload, void(int tab_id)); | |
| 23 MOCK_METHOD1(GoBack, void(int tab_id)); | |
| 24 MOCK_METHOD1(GoForward, void(int tab_id)); | |
| 25 | |
| 26 void NavigateToUrlText(int tab_id, const std::string& url_text) override; | |
| 27 | |
| 28 private: | |
| 29 void NotifyDelegateURLLoaded(int tab_id, const std::string& url_text); | |
| 30 | |
| 31 base::WeakPtrFactory<FakeNavigationFeature> weak_ptr_factory_; | |
|
Kevin M
2016/07/27 23:35:17
Is this ever used? I don't see a test case where F
Kevin M
2016/07/27 23:35:17
DISALLOW_COPY_AND_ASSIGNED
shaktisahu
2016/07/28 19:32:52
Done.
shaktisahu
2016/07/28 19:32:52
Yes, this is used in the C++ file to post a callba
Kevin M
2016/07/29 21:05:32
WeakPtr isn't useful though. Just use base::Unreta
shaktisahu
2016/07/29 22:57:30
Done. Thanks!
| |
| 32 }; | |
| 33 | |
| 34 } // namespace client | |
| 35 } // namespace blimp | |
| 36 | |
| 37 #endif // BLIMP_CLIENT_CORE_CONTENTS_FAKE_NAVIGATION_FEATURE_H_ | |
| OLD | NEW |