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

Side by Side Diff: chrome/test/media_router/media_router_base_browsertest.cc

Issue 2634213002: [Media Router] Add integration browser tests (Closed)
Patch Set: Created 3 years, 11 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "chrome/test/media_router/media_router_base_browsertest.h" 5 #include "chrome/test/media_router/media_router_base_browsertest.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 60
61 void MediaRouterBaseBrowserTest::TearDownOnMainThread() { 61 void MediaRouterBaseBrowserTest::TearDownOnMainThread() {
62 UninstallMRExtension(); 62 UninstallMRExtension();
63 extensions::ProcessManager* process_manager = 63 extensions::ProcessManager* process_manager =
64 extensions::ProcessManager::Get(browser()->profile()); 64 extensions::ProcessManager::Get(browser()->profile());
65 DCHECK(process_manager); 65 DCHECK(process_manager);
66 process_manager->RemoveObserver(this); 66 process_manager->RemoveObserver(this);
67 ExtensionBrowserTest::TearDownOnMainThread(); 67 ExtensionBrowserTest::TearDownOnMainThread();
68 } 68 }
69 69
70 Browser* MediaRouterBaseBrowserTest::GetIncognitoBrowserWithMRExtension() {
71 extension_load_event_.Reset();
72 LoadExtensionIncognito(extension_unpacked_);
mark a. foltz 2017/01/20 19:00:09 What if is_unpacked() == false?
73 extension_load_event_.Wait();
74
75 return CreateIncognitoBrowser();
76 }
77
70 void MediaRouterBaseBrowserTest::InstallAndEnableMRExtension() { 78 void MediaRouterBaseBrowserTest::InstallAndEnableMRExtension() {
71 if (is_unpacked()) { 79 if (is_unpacked()) {
72 const extensions::Extension* extension = LoadExtension(extension_unpacked_); 80 const extensions::Extension* extension = LoadExtension(extension_unpacked_);
73 extension_id_ = extension->id(); 81 extension_id_ = extension->id();
74 } else { 82 } else {
75 NOTIMPLEMENTED(); 83 NOTIMPLEMENTED();
mark a. foltz 2017/01/20 19:00:09 Can we just assume is_unpacked() is always true?
takumif 2017/02/07 22:17:35 Lei said there were plans to support packaged exte
76 } 84 }
77 } 85 }
78 86
79 void MediaRouterBaseBrowserTest::UninstallMRExtension() { 87 void MediaRouterBaseBrowserTest::UninstallMRExtension() {
80 if (!extension_id_.empty()) { 88 if (!extension_id_.empty()) {
81 UninstallExtension(extension_id_); 89 UninstallExtension(extension_id_);
82 } 90 }
83 } 91 }
84 92
85 bool MediaRouterBaseBrowserTest::ConditionalWait( 93 bool MediaRouterBaseBrowserTest::ConditionalWait(
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 if (PathExists(extension_path)) { 138 if (PathExists(extension_path)) {
131 extension_unpacked_ = extension_path; 139 extension_unpacked_ = extension_path;
132 } 140 }
133 } 141 }
134 142
135 // Exactly one of these two arguments should be provided. 143 // Exactly one of these two arguments should be provided.
136 ASSERT_NE(extension_crx_.empty(), extension_unpacked_.empty()); 144 ASSERT_NE(extension_crx_.empty(), extension_unpacked_.empty());
137 } 145 }
138 146
139 } // namespace media_router 147 } // namespace media_router
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698