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

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

Issue 10933047: Use base::TimeDelta in SafeBrowsingProtocolManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: React to mattm review 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
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 creates a safebrowsing service using test safebrowsing database 5 // This test creates a safebrowsing service using test safebrowsing database
6 // and a test protocol manager. It is used to test logics in safebrowsing 6 // and a test protocol manager. It is used to test logics in safebrowsing
7 // service. 7 // service.
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after
856 virtual void SetUpOnMainThread() { 856 virtual void SetUpOnMainThread() {
857 sb_service_ = g_browser_process->safe_browsing_service(); 857 sb_service_ = g_browser_process->safe_browsing_service();
858 ASSERT_TRUE(sb_service_ != NULL); 858 ASSERT_TRUE(sb_service_ != NULL);
859 } 859 }
860 860
861 virtual void CleanUpOnMainThread() { 861 virtual void CleanUpOnMainThread() {
862 sb_service_ = NULL; 862 sb_service_ = NULL;
863 } 863 }
864 864
865 void ForceUpdate() { 865 void ForceUpdate() {
866 sb_service_->protocol_manager_->ForceScheduleNextUpdate(0); 866 sb_service_->protocol_manager_->ForceScheduleNextUpdate(
867 base::TimeDelta::FromSeconds(0));
867 } 868 }
868 869
869 scoped_refptr<SafeBrowsingService> sb_service_; 870 scoped_refptr<SafeBrowsingService> sb_service_;
870 871
871 private: 872 private:
872 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingServiceCookieTest); 873 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingServiceCookieTest);
873 }; 874 };
874 875
875 // Test that a Safe Browsing database update request both sends cookies and can 876 // Test that a Safe Browsing database update request both sends cookies and can
876 // save cookies. 877 // save cookies.
877 IN_PROC_BROWSER_TEST_F(SafeBrowsingServiceCookieTest, TestSBUpdateCookies) { 878 IN_PROC_BROWSER_TEST_F(SafeBrowsingServiceCookieTest, TestSBUpdateCookies) {
878 content::WindowedNotificationObserver observer( 879 content::WindowedNotificationObserver observer(
879 chrome::NOTIFICATION_SAFE_BROWSING_UPDATE_COMPLETE, 880 chrome::NOTIFICATION_SAFE_BROWSING_UPDATE_COMPLETE,
880 content::Source<SafeBrowsingService>(sb_service_.get())); 881 content::Source<SafeBrowsingService>(sb_service_.get()));
881 BrowserThread::PostTask( 882 BrowserThread::PostTask(
882 BrowserThread::IO, FROM_HERE, 883 BrowserThread::IO, FROM_HERE,
883 base::Bind(&SafeBrowsingServiceCookieTest::ForceUpdate, this)); 884 base::Bind(&SafeBrowsingServiceCookieTest::ForceUpdate, this));
884 observer.Wait(); 885 observer.Wait();
885 } 886 }
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/protocol_manager_unittest.cc ('k') | chrome/browser/safe_browsing/safe_browsing_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698