| Index: blimp/client/core/blimp_navigation_controller_impl_unittest.cc
|
| diff --git a/blimp/client/core/blimp_navigation_controller_impl_unittest.cc b/blimp/client/core/blimp_navigation_controller_impl_unittest.cc
|
| index 2b2d7319e240526ed646ed8a69c00952ecbd938e..8e7fcbd8d728186ac9a04e5e2d7d08f14574c778 100644
|
| --- a/blimp/client/core/blimp_navigation_controller_impl_unittest.cc
|
| +++ b/blimp/client/core/blimp_navigation_controller_impl_unittest.cc
|
| @@ -5,10 +5,15 @@
|
| #include "blimp/client/core/blimp_navigation_controller_impl.h"
|
|
|
| #include "base/macros.h"
|
| +#include "base/memory/ptr_util.h"
|
| #include "base/message_loop/message_loop.h"
|
| #include "blimp/client/core/blimp_navigation_controller_delegate.h"
|
| +#include "blimp/client/feature/mock_navigation_feature.h"
|
| +#include "testing/gmock/include/gmock/gmock.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
|
|
| +using testing::_;
|
| +
|
| namespace blimp {
|
| namespace client {
|
| namespace {
|
| @@ -21,7 +26,11 @@ class TestBlimpNavigationControllerDelegate
|
| TestBlimpNavigationControllerDelegate() = default;
|
| ~TestBlimpNavigationControllerDelegate() override = default;
|
|
|
| - void NotifyURLLoaded(const GURL& url) override { last_loaded_url_ = url; }
|
| + void OnUrlChanged(const GURL& url) override { last_loaded_url_ = url; }
|
| + void OnFaviconChanged(const SkBitmap& favicon) override {}
|
| + void OnTitleChanged(const std::string& title) override {}
|
| + void OnLoadingChanged(bool loading) override {}
|
| + void OnPageLoadStatusUpdate(bool completed) override {}
|
|
|
| GURL GetLastLoadedURL() { return last_loaded_url_; }
|
|
|
| @@ -37,9 +46,21 @@ TEST(BlimpNavigationControllerImplTest, Basic) {
|
| TestBlimpNavigationControllerDelegate delegate;
|
| BlimpNavigationControllerImpl navigation_controller(&delegate);
|
|
|
| + MockNavigationFeature feature;
|
| + feature.SetDelegate(1, &navigation_controller);
|
| + navigation_controller.SetNavigationFeatureForTesting(&feature);
|
| +
|
| + EXPECT_CALL(feature, GoBack(_)).Times(1);
|
| + EXPECT_CALL(feature, GoForward(_)).Times(1);
|
| + EXPECT_CALL(feature, Reload(_)).Times(1);
|
| +
|
| navigation_controller.LoadURL(kExampleURL);
|
| EXPECT_EQ(kExampleURL, navigation_controller.GetURL());
|
|
|
| + navigation_controller.GoBack();
|
| + navigation_controller.GoForward();
|
| + navigation_controller.Reload();
|
| +
|
| loop.RunUntilIdle();
|
| EXPECT_EQ(kExampleURL, delegate.GetLastLoadedURL());
|
| }
|
|
|