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

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

Issue 10068036: RefCounted types should not have public destructors, chrome/browser/ part 5 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Win fix Created 8 years, 8 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
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 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 source->GetResponseAsString(&response_data_); 508 source->GetResponseAsString(&response_data_);
509 response_status_ = source->GetStatus().status(); 509 response_status_ = source->GetStatus().status();
510 StopUILoop(); 510 StopUILoop();
511 } 511 }
512 512
513 const std::string& response_data() { 513 const std::string& response_data() {
514 return response_data_; 514 return response_data_;
515 } 515 }
516 516
517 private: 517 private:
518 friend class base::RefCountedThreadSafe<SafeBrowsingServiceTestHelper>;
519 virtual ~SafeBrowsingServiceTestHelper() {}
520
518 // Stops UI loop after desired status is updated. 521 // Stops UI loop after desired status is updated.
519 void StopUILoop() { 522 void StopUILoop() {
520 EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::UI)); 523 EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::UI));
521 MessageLoopForUI::current()->Quit(); 524 MessageLoopForUI::current()->Quit();
522 } 525 }
523 526
524 // Fetch a URL. If message_loop_started is true, starts the message loop 527 // Fetch a URL. If message_loop_started is true, starts the message loop
525 // so the caller could wait till OnURLFetchComplete is called. 528 // so the caller could wait till OnURLFetchComplete is called.
526 net::URLRequestStatus::Status FetchUrl(const GURL& url) { 529 net::URLRequestStatus::Status FetchUrl(const GURL& url) {
527 url_fetcher_.reset(content::URLFetcher::Create( 530 url_fetcher_.reset(content::URLFetcher::Create(
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
638 } 641 }
639 642
640 // Verifies with server if test is done and waits till server responses. 643 // Verifies with server if test is done and waits till server responses.
641 EXPECT_EQ(net::URLRequestStatus::SUCCESS, 644 EXPECT_EQ(net::URLRequestStatus::SUCCESS,
642 safe_browsing_helper->VerifyTestComplete(server_host, 645 safe_browsing_helper->VerifyTestComplete(server_host,
643 server_port, 646 server_port,
644 last_step)); 647 last_step));
645 EXPECT_EQ("yes", safe_browsing_helper->response_data()); 648 EXPECT_EQ("yes", safe_browsing_helper->response_data());
646 test_server.Stop(); 649 test_server.Stop();
647 } 650 }
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc ('k') | chrome/browser/speech/speech_input_extension_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698