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

Side by Side Diff: chrome/browser/safe_browsing/safe_browsing_test.cc

Issue 10965047: Remove some methods on InProcessBrowserTest that are no longer needed now that we have content_brow… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/test/base/in_process_browser_test.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // This test uses the safebrowsing test server published at 5 // This test uses the safebrowsing test server published at
6 // http://code.google.com/p/google-safe-browsing/ to test the safebrowsing 6 // http://code.google.com/p/google-safe-browsing/ to test the safebrowsing
7 // protocol implemetation. Details of the safebrowsing testing flow is 7 // protocol implemetation. Details of the safebrowsing testing flow is
8 // documented at 8 // documented at
9 // http://code.google.com/p/google-safe-browsing/wiki/ProtocolTesting 9 // http://code.google.com/p/google-safe-browsing/wiki/ProtocolTesting
10 // 10 //
(...skipping 13 matching lines...) Expand all
24 #include "base/string_number_conversions.h" 24 #include "base/string_number_conversions.h"
25 #include "base/string_split.h" 25 #include "base/string_split.h"
26 #include "base/stringprintf.h" 26 #include "base/stringprintf.h"
27 #include "base/synchronization/lock.h" 27 #include "base/synchronization/lock.h"
28 #include "base/test/test_timeouts.h" 28 #include "base/test/test_timeouts.h"
29 #include "base/threading/platform_thread.h" 29 #include "base/threading/platform_thread.h"
30 #include "base/threading/thread.h" 30 #include "base/threading/thread.h"
31 #include "base/time.h" 31 #include "base/time.h"
32 #include "base/utf_string_conversions.h" 32 #include "base/utf_string_conversions.h"
33 #include "chrome/browser/browser_process.h" 33 #include "chrome/browser/browser_process.h"
34 #include "chrome/browser/profiles/profile.h"
34 #include "chrome/browser/safe_browsing/protocol_manager.h" 35 #include "chrome/browser/safe_browsing/protocol_manager.h"
35 #include "chrome/browser/safe_browsing/safe_browsing_service.h" 36 #include "chrome/browser/safe_browsing/safe_browsing_service.h"
37 #include "chrome/browser/ui/browser.h"
36 #include "chrome/common/chrome_notification_types.h" 38 #include "chrome/common/chrome_notification_types.h"
37 #include "chrome/common/chrome_switches.h" 39 #include "chrome/common/chrome_switches.h"
38 #include "chrome/common/url_constants.h" 40 #include "chrome/common/url_constants.h"
39 #include "chrome/test/base/in_process_browser_test.h" 41 #include "chrome/test/base/in_process_browser_test.h"
40 #include "chrome/test/base/ui_test_utils.h" 42 #include "chrome/test/base/ui_test_utils.h"
41 #include "content/public/browser/browser_context.h" 43 #include "content/public/browser/browser_context.h"
42 #include "content/public/test/test_browser_thread.h" 44 #include "content/public/test/test_browser_thread.h"
43 #include "net/base/host_resolver.h" 45 #include "net/base/host_resolver.h"
44 #include "net/base/load_flags.h" 46 #include "net/base/load_flags.h"
45 #include "net/base/net_log.h" 47 #include "net/base/net_log.h"
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 540
539 // See http://crbug.com/96459 541 // See http://crbug.com/96459
540 IN_PROC_BROWSER_TEST_F(SafeBrowsingServiceTest, 542 IN_PROC_BROWSER_TEST_F(SafeBrowsingServiceTest,
541 DISABLED_SafeBrowsingSystemTest) { 543 DISABLED_SafeBrowsingSystemTest) {
542 LOG(INFO) << "Start test"; 544 LOG(INFO) << "Start test";
543 const char* server_host = SafeBrowsingTestServer::Host(); 545 const char* server_host = SafeBrowsingTestServer::Host();
544 int server_port = SafeBrowsingTestServer::Port(); 546 int server_port = SafeBrowsingTestServer::Port();
545 ASSERT_TRUE(InitSafeBrowsingService()); 547 ASSERT_TRUE(InitSafeBrowsingService());
546 548
547 net::URLRequestContextGetter* request_context = 549 net::URLRequestContextGetter* request_context =
548 GetBrowserContext()->GetRequestContext(); 550 browser()->profile()->GetRequestContext();
549 scoped_refptr<SafeBrowsingServiceTestHelper> safe_browsing_helper( 551 scoped_refptr<SafeBrowsingServiceTestHelper> safe_browsing_helper(
550 new SafeBrowsingServiceTestHelper(this, request_context)); 552 new SafeBrowsingServiceTestHelper(this, request_context));
551 int last_step = 0; 553 int last_step = 0;
552 FilePath datafile_path = FilePath(kDataFile); 554 FilePath datafile_path = FilePath(kDataFile);
553 SafeBrowsingTestServer test_server(datafile_path); 555 SafeBrowsingTestServer test_server(datafile_path);
554 ASSERT_TRUE(test_server.Start()); 556 ASSERT_TRUE(test_server.Start());
555 557
556 // Make sure the server is running. 558 // Make sure the server is running.
557 safe_browsing_helper->WaitTillServerReady(server_host, server_port); 559 safe_browsing_helper->WaitTillServerReady(server_host, server_port);
558 560
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 } 632 }
631 633
632 // Verifies with server if test is done and waits till server responses. 634 // Verifies with server if test is done and waits till server responses.
633 EXPECT_EQ(net::URLRequestStatus::SUCCESS, 635 EXPECT_EQ(net::URLRequestStatus::SUCCESS,
634 safe_browsing_helper->VerifyTestComplete(server_host, 636 safe_browsing_helper->VerifyTestComplete(server_host,
635 server_port, 637 server_port,
636 last_step)); 638 last_step));
637 EXPECT_EQ("yes", safe_browsing_helper->response_data()); 639 EXPECT_EQ("yes", safe_browsing_helper->response_data());
638 test_server.Stop(); 640 test_server.Stop();
639 } 641 }
OLDNEW
« no previous file with comments | « no previous file | chrome/test/base/in_process_browser_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698