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

Side by Side Diff: chrome/browser/extensions/extension_messages_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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/base64.h" 5 #include "base/base64.h"
6 #include "base/files/file_path.h" 6 #include "base/files/file_path.h"
7 #include "base/json/json_reader.h" 7 #include "base/json/json_reader.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 chromium_org_url().spec().c_str())); 369 chromium_org_url().spec().c_str()));
370 CHECK(hosted_app.get()); 370 CHECK(hosted_app.get());
371 return hosted_app; 371 return hosted_app;
372 } 372 }
373 373
374 void InitializeTestServer() { 374 void InitializeTestServer() {
375 base::FilePath test_data; 375 base::FilePath test_data;
376 EXPECT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_data)); 376 EXPECT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_data));
377 embedded_test_server()->ServeFilesFromDirectory(test_data.AppendASCII( 377 embedded_test_server()->ServeFilesFromDirectory(test_data.AppendASCII(
378 "extensions/api_test/messaging/externally_connectable/sites")); 378 "extensions/api_test/messaging/externally_connectable/sites"));
379 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); 379 ASSERT_TRUE(embedded_test_server()->Start());
380 host_resolver()->AddRule("*", embedded_test_server()->base_url().host()); 380 host_resolver()->AddRule("*", embedded_test_server()->base_url().host());
381 } 381 }
382 382
383 const char* close_background_message() { 383 const char* close_background_message() {
384 return "closeBackgroundPage"; 384 return "closeBackgroundPage";
385 } 385 }
386 386
387 private: 387 private:
388 scoped_refptr<const Extension> LoadExtensionIntoDir( 388 scoped_refptr<const Extension> LoadExtensionIntoDir(
389 TestExtensionDir* dir, 389 TestExtensionDir* dir,
(...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after
1192 ui_test_utils::NavigateToURL(browser(), chromium_org_url()); 1192 ui_test_utils::NavigateToURL(browser(), chromium_org_url());
1193 EXPECT_EQ(COULD_NOT_ESTABLISH_CONNECTION_ERROR, 1193 EXPECT_EQ(COULD_NOT_ESTABLISH_CONNECTION_ERROR,
1194 CanConnectAndSendMessagesToMainFrame(invalid.get())); 1194 CanConnectAndSendMessagesToMainFrame(invalid.get()));
1195 } 1195 }
1196 1196
1197 #endif // !defined(OS_WIN) - http://crbug.com/350517. 1197 #endif // !defined(OS_WIN) - http://crbug.com/350517.
1198 1198
1199 } // namespace 1199 } // namespace
1200 1200
1201 }; // namespace extensions 1201 }; // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_loading_browsertest.cc ('k') | chrome/browser/extensions/extension_nacl_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698