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

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

Issue 2299453002: Restrict number of BlimpContents to [0, 1] (Closed)
Patch Set: patch failure fix 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
« no previous file with comments | « blimp/client/core/contents/blimp_contents_manager.cc ('k') | blimp/client/public/blimp_client_context.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..89da6c8f66d9d63c02871cc5d455af3c1e80f93a 100644
--- a/blimp/client/core/contents/blimp_contents_manager_unittest.cc
+++ b/blimp/client/core/contents/blimp_contents_manager_unittest.cc
@@ -82,6 +82,28 @@ TEST(BlimpContentsManagerUnittest, GetDestroyedBlimpContents) {
EXPECT_EQ(nullptr, blimp_contents_manager.GetBlimpContents(id));
}
+// TODO(mlliu): remove this test case (http://crbug.com/642558)
+TEST(BlimpContentsManagerUnittest, CreateTwoBlimpContentsDestroyAndCreate) {
+ 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();
+ EXPECT_NE(blimp_contents, nullptr);
+
+ 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();
+ EXPECT_NE(third_blimp_contents, nullptr);
+}
+
} // namespace
} // namespace client
} // namespace blimp
« no previous file with comments | « blimp/client/core/contents/blimp_contents_manager.cc ('k') | blimp/client/public/blimp_client_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698