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

Unified Diff: blimp/client/core/contents/blimp_contents_impl_unittest.cc

Issue 2255533002: Add TabControlFeature to BlimpClientContextImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sync to head 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 side-by-side diff with in-line comments
Download patch
Index: blimp/client/core/contents/blimp_contents_impl_unittest.cc
diff --git a/blimp/client/core/contents/blimp_contents_impl_unittest.cc b/blimp/client/core/contents/blimp_contents_impl_unittest.cc
index 98fa2066246edf05c0c085cd0116196bd5a7edec..5ae6f818eafdf84f437f31e50575dad6739af172 100644
--- a/blimp/client/core/contents/blimp_contents_impl_unittest.cc
+++ b/blimp/client/core/contents/blimp_contents_impl_unittest.cc
@@ -5,8 +5,8 @@
#include "blimp/client/core/contents/blimp_contents_impl.h"
#include "base/message_loop/message_loop.h"
-#include "blimp/client/core/contents/blimp_contents_impl.h"
#include "blimp/client/core/contents/fake_navigation_feature.h"
+#include "blimp/client/core/contents/tab_control_feature.h"
#include "blimp/client/public/contents/blimp_contents_observer.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -31,9 +31,19 @@ class MockBlimpContentsObserver : public BlimpContentsObserver {
DISALLOW_COPY_AND_ASSIGN(MockBlimpContentsObserver);
};
+class MockTabControlFeature : public TabControlFeature {
+ public:
+ MockTabControlFeature() {}
+ ~MockTabControlFeature() override = default;
+ MOCK_METHOD2(SetSizeAndScale, void(const gfx::Size&, float));
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(MockTabControlFeature);
+};
+
TEST(BlimpContentsImplTest, LoadURLAndNotifyObservers) {
base::MessageLoop loop;
- BlimpContentsImpl blimp_contents(kDummyTabId);
+ BlimpContentsImpl blimp_contents(kDummyTabId, nullptr);
BlimpNavigationControllerImpl& navigation_controller =
blimp_contents.GetNavigationController();
@@ -61,6 +71,21 @@ TEST(BlimpContentsImplTest, LoadURLAndNotifyObservers) {
EXPECT_EQ(kOtherExampleURL, navigation_controller.GetURL().spec());
}
+TEST(BlimpContentsImplTest, SetSizeAndScaleThroughTabControlFeature) {
+ int width = 10;
+ int height = 15;
+ float dp_to_px = 1.23f;
+
+ MockTabControlFeature tab_control_feature;
+ base::MessageLoop loop;
+ BlimpContentsImpl blimp_contents(kDummyTabId, &tab_control_feature);
+
+ EXPECT_CALL(tab_control_feature,
+ SetSizeAndScale(gfx::Size(width, height), dp_to_px)).Times(1);
+
+ blimp_contents.SetSizeAndScale(gfx::Size(width, height), dp_to_px);
+}
+
} // namespace
} // namespace client
} // namespace blimp
« no previous file with comments | « blimp/client/core/contents/blimp_contents_impl.cc ('k') | blimp/client/core/contents/blimp_contents_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698