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

Side by Side Diff: blimp/client/core/blimp_client_context_impl_unittest.cc

Issue 2211613002: Add AssignmentSource to BlimpClientContextImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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 unified diff | Download patch
OLDNEW
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/blimp_client_context_impl.h" 5 #include "blimp/client/core/blimp_client_context_impl.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/threading/thread.h" 10 #include "base/threading/thread.h"
(...skipping 17 matching lines...) Expand all
28 options.message_loop_type = base::MessageLoop::TYPE_IO; 28 options.message_loop_type = base::MessageLoop::TYPE_IO;
29 io_thread_.StartWithOptions(options); 29 io_thread_.StartWithOptions(options);
30 } 30 }
31 31
32 void TearDown() override { 32 void TearDown() override {
33 io_thread_.Stop(); 33 io_thread_.Stop();
34 base::RunLoop().RunUntilIdle(); 34 base::RunLoop().RunUntilIdle();
35 } 35 }
36 36
37 protected: 37 protected:
38 // The thread to use for IO related tasks. 38 // The thread to use for IO related tasks.
Kevin M 2016/08/04 17:44:17 Not needed
nyquist 2016/08/05 21:22:38 Done.
39 base::Thread io_thread_; 39 base::Thread io_thread_;
40 40
41 private: 41 private:
42 // Message loop for the test thread. 42 // Message loop for the test thread.
Kevin M 2016/08/04 17:44:17 Not needed
nyquist 2016/08/05 21:22:38 Done.
43 base::MessageLoop message_loop_; 43 base::MessageLoop message_loop_;
44 44
45 DISALLOW_COPY_AND_ASSIGN(BlimpClientContextImplTest); 45 DISALLOW_COPY_AND_ASSIGN(BlimpClientContextImplTest);
46 }; 46 };
47 47
48 TEST_F(BlimpClientContextImplTest, CreatedBlimpContentsGetsHelpersAttached) { 48 TEST_F(BlimpClientContextImplTest, CreatedBlimpContentsGetsHelpersAttached) {
49 BlimpClientContextImpl blimp_client_context(io_thread_.task_runner()); 49 BlimpClientContextImpl blimp_client_context(io_thread_.task_runner(),
50 io_thread_.task_runner());
50 TestBlimpClientContextDelegate delegate; 51 TestBlimpClientContextDelegate delegate;
51 blimp_client_context.SetDelegate(&delegate); 52 blimp_client_context.SetDelegate(&delegate);
52 53
53 BlimpContents* attached_blimp_contents = nullptr; 54 BlimpContents* attached_blimp_contents = nullptr;
54 55
55 EXPECT_CALL(delegate, AttachBlimpContentsHelpers(testing::_)) 56 EXPECT_CALL(delegate, AttachBlimpContentsHelpers(testing::_))
56 .WillOnce(testing::SaveArg<0>(&attached_blimp_contents)) 57 .WillOnce(testing::SaveArg<0>(&attached_blimp_contents))
57 .RetiresOnSaturation(); 58 .RetiresOnSaturation();
58 59
59 std::unique_ptr<BlimpContents> blimp_contents = 60 std::unique_ptr<BlimpContents> blimp_contents =
60 blimp_client_context.CreateBlimpContents(); 61 blimp_client_context.CreateBlimpContents();
61 DCHECK(blimp_contents); 62 DCHECK(blimp_contents);
62 DCHECK_EQ(blimp_contents.get(), attached_blimp_contents); 63 DCHECK_EQ(blimp_contents.get(), attached_blimp_contents);
63 } 64 }
64 65
65 } // namespace 66 } // namespace
66 } // namespace client 67 } // namespace client
67 } // namespace blimp 68 } // namespace blimp
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698