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

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

Issue 2299453002: Restrict number of BlimpContents to [0, 1] (Closed)
Patch Set: 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_manager_unittest.cc
diff --git a/blimp/client/core/contents/blimp_contents_manager_unittest.cc b/blimp/client/core/contents/blimp_contents_manager_unittest.cc
index 0a8f1f805f3c0cf10149b066d70bc96af583b290..f035b1a15d61dae551c590077eb01c8519ed3fa6 100644
--- a/blimp/client/core/contents/blimp_contents_manager_unittest.cc
+++ b/blimp/client/core/contents/blimp_contents_manager_unittest.cc
@@ -82,6 +82,27 @@ TEST(BlimpContentsManagerUnittest, GetDestroyedBlimpContents) {
EXPECT_EQ(nullptr, blimp_contents_manager.GetBlimpContents(id));
}
+TEST(BlimpContentsManagerUnittest, CreateTwoBlimpContentsDestroyAndCreate) {
David Trainor- moved to gerrit 2016/08/30 23:31:12 Add a TODO and a bug to remove this test and the r
Menglin 2016/08/31 00:13:02 Done.
+ base::MessageLoop loop;
+ MockTabControlFeature tab_control_feature;
+ BlimpContentsManager blimp_contents_manager(nullptr, nullptr,
+ &tab_control_feature);
+
+ EXPECT_CALL(tab_control_feature, CreateTab(_)).Times(2);
+ std::unique_ptr<BlimpContentsImpl> blimp_contents =
+ blimp_contents_manager.CreateBlimpContents();
+ DCHECK(blimp_contents);
David Trainor- moved to gerrit 2016/08/30 23:31:12 EXPECT_NE()? Same below.
Menglin 2016/08/31 00:13:02 Done.
+
+ std::unique_ptr<BlimpContentsImpl> second_blimp_contents =
+ blimp_contents_manager.CreateBlimpContents();
+ EXPECT_EQ(second_blimp_contents, nullptr);
+
+ blimp_contents.reset();
+ std::unique_ptr<BlimpContentsImpl> third_blimp_contents =
+ blimp_contents_manager.CreateBlimpContents();
+ DCHECK(third_blimp_contents);
+}
+
} // namespace
} // namespace client
} // namespace blimp

Powered by Google App Engine
This is Rietveld 408576698