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

Side by Side Diff: chrome/browser/media/router/media_router_factory_unittest.cc

Issue 2294973002: Create MediaRouterActionController and MediaRouterUIService (Closed)
Patch Set: Modify BUILD.gn files, rebase Created 4 years, 3 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 <memory> 5 #include <memory>
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "chrome/browser/media/router/media_router_factory.h" 8 #include "chrome/browser/media/router/media_router_factory.h"
9 #include "chrome/browser/media/router/mock_media_router.h" 9 #include "chrome/browser/media/router/mock_media_router.h"
10 #include "chrome/test/base/testing_profile.h" 10 #include "chrome/test/base/testing_profile.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 // Makes sure a MediaRouter can be created from an incognito Profile. 46 // Makes sure a MediaRouter can be created from an incognito Profile.
47 MediaRouter* router = 47 MediaRouter* router =
48 MediaRouterFactory::GetApiForBrowserContext(incognito_profile); 48 MediaRouterFactory::GetApiForBrowserContext(incognito_profile);
49 ASSERT_TRUE(router); 49 ASSERT_TRUE(router);
50 50
51 // A Profile and its incognito Profile share the same MediaRouter instance. 51 // A Profile and its incognito Profile share the same MediaRouter instance.
52 ASSERT_EQ(router, MediaRouterFactory::GetApiForBrowserContext(profile())); 52 ASSERT_EQ(router, MediaRouterFactory::GetApiForBrowserContext(profile()));
53 } 53 }
54 54
55 TEST_F(MediaRouterFactoryTest, IncognitoBrowserContextShutdown) { 55 TEST_F(MediaRouterFactoryTest, IncognitoBrowserContextShutdown) {
56 MediaRouterFactory::GetMediaRouterFactoryForTest()->SetTestingFactory( 56 MediaRouterFactory::GetInstance()->SetTestingFactory(profile(),
57 profile(), &CreateMockMediaRouter); 57 &CreateMockMediaRouter);
58 58
59 // Creates an incognito profile. 59 // Creates an incognito profile.
60 profile()->GetOffTheRecordProfile(); 60 profile()->GetOffTheRecordProfile();
61 MockMediaRouter* router = static_cast<MockMediaRouter*>( 61 MockMediaRouter* router = static_cast<MockMediaRouter*>(
62 MediaRouterFactory::GetApiForBrowserContext(profile())); 62 MediaRouterFactory::GetApiForBrowserContext(profile()));
63 ASSERT_TRUE(router); 63 ASSERT_TRUE(router);
64 EXPECT_CALL(*router, OnIncognitoProfileShutdown()); 64 EXPECT_CALL(*router, OnIncognitoProfileShutdown());
65 profile()->DestroyOffTheRecordProfile(); 65 profile()->DestroyOffTheRecordProfile();
66 } 66 }
67 67
68 } // namespace media_router 68 } // namespace media_router
OLDNEW
« no previous file with comments | « chrome/browser/media/router/media_router_factory.cc ('k') | chrome/browser/media/router/media_router_ui_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698