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

Unified Diff: blimp/client/core/contents/fake_navigation_feature.h

Issue 2058263002: Tied up BlimpNavigationController to NavigationFeature (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@blimp_core
Patch Set: Moved NavigationFeature to blimp/client/core/contents Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: blimp/client/core/contents/fake_navigation_feature.h
diff --git a/blimp/client/core/contents/fake_navigation_feature.h b/blimp/client/core/contents/fake_navigation_feature.h
new file mode 100644
index 0000000000000000000000000000000000000000..146497b1e45aa948b5d66313a0ae44c63cbf9eda
--- /dev/null
+++ b/blimp/client/core/contents/fake_navigation_feature.h
@@ -0,0 +1,37 @@
+// Copyright 2016 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.
+
+#ifndef BLIMP_CLIENT_CORE_CONTENTS_FAKE_NAVIGATION_FEATURE_H_
+#define BLIMP_CLIENT_CORE_CONTENTS_FAKE_NAVIGATION_FEATURE_H_
+
+#include <string>
+
+#include "base/memory/weak_ptr.h"
+#include "blimp/client/core/contents/navigation_feature.h"
+#include "testing/gmock/include/gmock/gmock.h"
+
+namespace blimp {
+namespace client {
+
+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
+ public:
+ FakeNavigationFeature();
+ ~FakeNavigationFeature();
+
+ MOCK_METHOD1(Reload, void(int tab_id));
+ MOCK_METHOD1(GoBack, void(int tab_id));
+ MOCK_METHOD1(GoForward, void(int tab_id));
+
+ void NavigateToUrlText(int tab_id, const std::string& url_text) override;
+
+ private:
+ void NotifyDelegateURLLoaded(int tab_id, const std::string& url_text);
+
+ 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!
+};
+
+} // namespace client
+} // namespace blimp
+
+#endif // BLIMP_CLIENT_CORE_CONTENTS_FAKE_NAVIGATION_FEATURE_H_

Powered by Google App Engine
This is Rietveld 408576698