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

Side by Side Diff: blimp/client/core/contents/blimp_contents_manager_unittest.cc

Issue 2201433002: Migrate TabControlFeature from 0.5 to 0.6 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: some more compile error 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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "blimp/client/core/contents/blimp_contents_manager.h"
6
7 #include "base/memory/ptr_util.h"
8 #include "base/message_loop/message_loop.h"
9 #include "blimp/client/core/contents/blimp_contents_impl.h"
10 #include "testing/gtest/include/gtest/gtest.h"
11
12 namespace {
13 const int kDummyTabId = 0;
14 }
15
16 namespace blimp {
17 namespace client {
18 namespace {
19
20 TEST(BlimpContentsManagerUnittest, GetExistingBlimpContents) {
21 base::MessageLoop loop;
22 BlimpContentsManager blimp_contents_manager;
23
24 std::unique_ptr<BlimpContentsImpl> blimp_contents =
25 blimp_contents_manager.CreateBlimpContents();
26 int id = blimp_contents->id();
27 BlimpContentsImpl* existing_contents =
28 blimp_contents_manager.GetBlimpContents(id);
29 EXPECT_EQ(blimp_contents.get(), existing_contents);
30 }
31
32 TEST(BlimpContentsManagerUnittest, GetNonExistingBlimpContents) {
33 BlimpContentsManager blimp_contents_manager;
34
35 BlimpContentsImpl* existing_contents =
36 blimp_contents_manager.GetBlimpContents(kDummyTabId);
37 EXPECT_EQ(nullptr, existing_contents);
38 }
39
40 TEST(BlimpContentsManagerUnittest, GetDestroyedBlimpContents) {
41 base::MessageLoop loop;
42 BlimpContentsManager blimp_contents_manager;
43 int id;
44
45 std::unique_ptr<BlimpContentsImpl> blimp_contents =
46 blimp_contents_manager.CreateBlimpContents();
47 id = blimp_contents.get()->id();
48 BlimpContentsImpl* existing_contents =
49 blimp_contents_manager.GetBlimpContents(id);
50 EXPECT_EQ(blimp_contents.get(), existing_contents);
51 blimp_contents.reset();
52
53 loop.RunUntilIdle();
54 EXPECT_EQ(nullptr, blimp_contents_manager.GetBlimpContents(id));
55 }
56
57 } // namespace
58 } // namespace client
59 } // namespace blimp
OLDNEW
« no previous file with comments | « blimp/client/core/contents/blimp_contents_manager.cc ('k') | blimp/client/core/contents/blimp_contents_observer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698