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

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

Issue 2379703002: [Presentation API] (alternative) 1-UA: send message between controller and receiver page (Closed)
Patch Set: merge with master Created 4 years, 1 month 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 <memory>
6
7 #include "chrome/browser/media/router/offscreen_presentation_manager_factory.h"
8 #include "chrome/test/base/testing_profile.h"
9 #include "content/public/browser/browser_context.h"
10 #include "content/public/test/test_browser_thread_bundle.h"
11 #include "testing/gtest/include/gtest/gtest.h"
12
13 namespace media_router {
14
15 class OffscreenPresentationManagerFactoryTest : public testing::Test {
16 protected:
17 OffscreenPresentationManagerFactoryTest() {}
18 ~OffscreenPresentationManagerFactoryTest() override {}
19
20 Profile* profile() { return &profile_; }
21
22 private:
23 content::TestBrowserThreadBundle thread_bundle_;
24 TestingProfile profile_;
25 };
26
27 TEST_F(OffscreenPresentationManagerFactoryTest, CreateForRegularProfile) {
28 ASSERT_TRUE(OffscreenPresentationManagerFactory::GetOrCreateForBrowserContext(
29 profile()));
30 }
31
32 TEST_F(OffscreenPresentationManagerFactoryTest, CreateForOffTheRecordProfile) {
33 Profile* incognito_profile = profile()->GetOffTheRecordProfile();
34 ASSERT_TRUE(incognito_profile);
35
36 // Makes sure a OffscreenPresentationManager can be created from an incognito
37 // Profile.
38 OffscreenPresentationManager* manager =
39 OffscreenPresentationManagerFactory::GetOrCreateForBrowserContext(
40 incognito_profile);
41 ASSERT_TRUE(manager);
42
43 // A Profile and its incognito Profile share the same
44 // OffscreenPresentationManager instance.
45 ASSERT_EQ(manager,
46 OffscreenPresentationManagerFactory::GetOrCreateForBrowserContext(
47 profile()));
48 }
49
50 } // namespace media_router
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698