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

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

Issue 2211473003: Remove calls to deprecated MessageLoop methods on Windows and Linux. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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/contents/blimp_contents_impl.h" 5 #include "blimp/client/core/contents/blimp_contents_impl.h"
6 6
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/run_loop.h"
8 #include "blimp/client/core/contents/blimp_contents_impl.h" 9 #include "blimp/client/core/contents/blimp_contents_impl.h"
9 #include "blimp/client/core/contents/fake_navigation_feature.h" 10 #include "blimp/client/core/contents/fake_navigation_feature.h"
10 #include "blimp/client/public/contents/blimp_contents_observer.h" 11 #include "blimp/client/public/contents/blimp_contents_observer.h"
11 #include "testing/gmock/include/gmock/gmock.h" 12 #include "testing/gmock/include/gmock/gmock.h"
12 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
13 14
14 namespace blimp { 15 namespace blimp {
15 namespace client { 16 namespace client {
16 namespace { 17 namespace {
17 18
(...skipping 23 matching lines...) Expand all
41 42
42 testing::StrictMock<MockBlimpContentsObserver> observer1; 43 testing::StrictMock<MockBlimpContentsObserver> observer1;
43 blimp_contents.AddObserver(&observer1); 44 blimp_contents.AddObserver(&observer1);
44 testing::StrictMock<MockBlimpContentsObserver> observer2; 45 testing::StrictMock<MockBlimpContentsObserver> observer2;
45 blimp_contents.AddObserver(&observer2); 46 blimp_contents.AddObserver(&observer2);
46 47
47 EXPECT_CALL(observer1, OnNavigationStateChanged()); 48 EXPECT_CALL(observer1, OnNavigationStateChanged());
48 EXPECT_CALL(observer2, OnNavigationStateChanged()).Times(2); 49 EXPECT_CALL(observer2, OnNavigationStateChanged()).Times(2);
49 50
50 navigation_controller.LoadURL(GURL(kExampleURL)); 51 navigation_controller.LoadURL(GURL(kExampleURL));
51 loop.RunUntilIdle(); 52 base::RunLoop().RunUntilIdle();
52 53
53 EXPECT_EQ(kExampleURL, navigation_controller.GetURL().spec()); 54 EXPECT_EQ(kExampleURL, navigation_controller.GetURL().spec());
54 55
55 // Observer should no longer receive callbacks. 56 // Observer should no longer receive callbacks.
56 blimp_contents.RemoveObserver(&observer1); 57 blimp_contents.RemoveObserver(&observer1);
57 58
58 navigation_controller.LoadURL(GURL(kOtherExampleURL)); 59 navigation_controller.LoadURL(GURL(kOtherExampleURL));
59 loop.RunUntilIdle(); 60 base::RunLoop().RunUntilIdle();
60 61
61 EXPECT_EQ(kOtherExampleURL, navigation_controller.GetURL().spec()); 62 EXPECT_EQ(kOtherExampleURL, navigation_controller.GetURL().spec());
62 } 63 }
63 64
64 } // namespace 65 } // namespace
65 } // namespace client 66 } // namespace client
66 } // namespace blimp 67 } // namespace blimp
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698