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

Side by Side Diff: chrome/browser/devtools/device/webrtc/webrtc_device_provider_browsertest.cc

Issue 762903004: Enabling WebRTCDeviceProvider under enable-devtools-experiments flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@new-web-client
Patch Set: Created 6 years 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 2014 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 "base/bind.h"
6 #include "chrome/browser/devtools/device/webrtc/webrtc_device_provider.h"
7 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
8 #include "chrome/browser/signin/signin_manager_factory.h"
9 #include "chrome/browser/ui/browser.h"
10 #include "chrome/test/base/in_process_browser_test.h"
11 #include "components/signin/core/browser/signin_manager.h"
12 #include "content/public/browser/browser_thread.h"
13 #include "content/public/test/test_utils.h"
14
15 using content::BrowserThread;
16 using content::MessageLoopRunner;
17
18 class WebRTCDeviceProviderTest : public InProcessBrowserTest {
19 protected:
20 scoped_refptr<WebRTCDeviceProvider> CreateProvider();
21 static void Unreference(
22 scoped_refptr<WebRTCDeviceProvider> provider);
23
24 scoped_refptr<WebRTCDeviceProvider> provider_;
25 };
26
27 scoped_refptr<WebRTCDeviceProvider>
28 WebRTCDeviceProviderTest::CreateProvider() {
29 return new WebRTCDeviceProvider(
30 browser()->profile(),
31 SigninManagerFactory::GetForProfile(browser()->profile()),
32 ProfileOAuth2TokenServiceFactory::GetForProfile(browser()->profile()));
33 }
34
35 // static
36 void WebRTCDeviceProviderTest::Unreference(
37 scoped_refptr<WebRTCDeviceProvider> provider) {
38 }
39
40 IN_PROC_BROWSER_TEST_F(WebRTCDeviceProviderTest, TestDeleteSelf) {
41 scoped_refptr<MessageLoopRunner> runner = new MessageLoopRunner;
42 BrowserThread::PostTaskAndReply(
43 BrowserThread::IO,
44 FROM_HERE,
45 base::Bind(&Unreference, CreateProvider()),
46 runner->QuitClosure());
47 runner->Run();
48 }
49
50 IN_PROC_BROWSER_TEST_F(WebRTCDeviceProviderTest, OutliveProfile) {
51 provider_ = CreateProvider();
52 }
OLDNEW
« no previous file with comments | « chrome/browser/devtools/device/webrtc/webrtc_device_provider.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698