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

Side by Side Diff: chrome/browser/extensions/api/desktop_capture/desktop_capture_apitest.cc

Issue 1409163006: Migrating tests to use EmbeddedTestServer (/chrome/browser misc) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 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
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <queue> 5 #include <queue>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/thread_task_runner_handle.h" 10 #include "base/thread_task_runner_handle.h"
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 ASSERT_TRUE(RunExtensionTest("desktop_capture")) << message_; 183 ASSERT_TRUE(RunExtensionTest("desktop_capture")) << message_;
184 } 184 }
185 185
186 // Test is flaky http://crbug.com/301887. 186 // Test is flaky http://crbug.com/301887.
187 IN_PROC_BROWSER_TEST_F(DesktopCaptureApiTest, DISABLED_Delegation) { 187 IN_PROC_BROWSER_TEST_F(DesktopCaptureApiTest, DISABLED_Delegation) {
188 // Initialize test server. 188 // Initialize test server.
189 base::FilePath test_data; 189 base::FilePath test_data;
190 EXPECT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_data)); 190 EXPECT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_data));
191 embedded_test_server()->ServeFilesFromDirectory(test_data.AppendASCII( 191 embedded_test_server()->ServeFilesFromDirectory(test_data.AppendASCII(
192 "extensions/api_test/desktop_capture_delegate")); 192 "extensions/api_test/desktop_capture_delegate"));
193 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); 193 ASSERT_TRUE(embedded_test_server()->Start());
194 host_resolver()->AddRule("*", embedded_test_server()->base_url().host()); 194 host_resolver()->AddRule("*", embedded_test_server()->base_url().host());
195 195
196 // Load extension. 196 // Load extension.
197 base::FilePath extension_path = 197 base::FilePath extension_path =
198 test_data_dir_.AppendASCII("desktop_capture_delegate"); 198 test_data_dir_.AppendASCII("desktop_capture_delegate");
199 const Extension* extension = LoadExtensionWithFlags( 199 const Extension* extension = LoadExtensionWithFlags(
200 extension_path, ExtensionBrowserTest::kFlagNone); 200 extension_path, ExtensionBrowserTest::kFlagNone);
201 ASSERT_TRUE(extension); 201 ASSERT_TRUE(extension);
202 202
203 ui_test_utils::NavigateToURL( 203 ui_test_utils::NavigateToURL(
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 EXPECT_TRUE(result); 236 EXPECT_TRUE(result);
237 EXPECT_TRUE(test_flags[2].picker_created); 237 EXPECT_TRUE(test_flags[2].picker_created);
238 EXPECT_FALSE(test_flags[2].picker_deleted); 238 EXPECT_FALSE(test_flags[2].picker_deleted);
239 239
240 web_contents->Close(); 240 web_contents->Close();
241 destroyed_watcher.Wait(); 241 destroyed_watcher.Wait();
242 EXPECT_TRUE(test_flags[2].picker_deleted); 242 EXPECT_TRUE(test_flags[2].picker_deleted);
243 } 243 }
244 244
245 } // namespace extensions 245 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698