Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "blimp/client/core/contents/blimp_contents_manager.h" | 5 #include "blimp/client/core/contents/blimp_contents_manager.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "blimp/client/core/contents/blimp_contents_impl.h" | 9 #include "blimp/client/core/contents/blimp_contents_impl.h" |
| 10 #include "blimp/client/core/contents/tab_control_feature.h" | 10 #include "blimp/client/core/contents/tab_control_feature.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 75 blimp_contents_manager.GetBlimpContents(id); | 75 blimp_contents_manager.GetBlimpContents(id); |
| 76 EXPECT_EQ(blimp_contents.get(), existing_contents); | 76 EXPECT_EQ(blimp_contents.get(), existing_contents); |
| 77 | 77 |
| 78 EXPECT_CALL(tab_control_feature, CloseTab(id)).Times(1); | 78 EXPECT_CALL(tab_control_feature, CloseTab(id)).Times(1); |
| 79 blimp_contents.reset(); | 79 blimp_contents.reset(); |
| 80 | 80 |
| 81 loop.RunUntilIdle(); | 81 loop.RunUntilIdle(); |
| 82 EXPECT_EQ(nullptr, blimp_contents_manager.GetBlimpContents(id)); | 82 EXPECT_EQ(nullptr, blimp_contents_manager.GetBlimpContents(id)); |
| 83 } | 83 } |
| 84 | 84 |
| 85 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.
| |
| 86 base::MessageLoop loop; | |
| 87 MockTabControlFeature tab_control_feature; | |
| 88 BlimpContentsManager blimp_contents_manager(nullptr, nullptr, | |
| 89 &tab_control_feature); | |
| 90 | |
| 91 EXPECT_CALL(tab_control_feature, CreateTab(_)).Times(2); | |
| 92 std::unique_ptr<BlimpContentsImpl> blimp_contents = | |
| 93 blimp_contents_manager.CreateBlimpContents(); | |
| 94 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.
| |
| 95 | |
| 96 std::unique_ptr<BlimpContentsImpl> second_blimp_contents = | |
| 97 blimp_contents_manager.CreateBlimpContents(); | |
| 98 EXPECT_EQ(second_blimp_contents, nullptr); | |
| 99 | |
| 100 blimp_contents.reset(); | |
| 101 std::unique_ptr<BlimpContentsImpl> third_blimp_contents = | |
| 102 blimp_contents_manager.CreateBlimpContents(); | |
| 103 DCHECK(third_blimp_contents); | |
| 104 } | |
| 105 | |
| 85 } // namespace | 106 } // namespace |
| 86 } // namespace client | 107 } // namespace client |
| 87 } // namespace blimp | 108 } // namespace blimp |
| OLD | NEW |