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

Side by Side Diff: chrome/browser/download/download_request_limiter_unittest.cc

Issue 684613002: Standardize usage of virtual/override/final specifiers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 "chrome/browser/download/download_request_limiter.h" 5 #include "chrome/browser/download/download_request_limiter.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "chrome/browser/download/download_request_infobar_delegate.h" 9 #include "chrome/browser/download/download_request_infobar_delegate.h"
10 #include "chrome/browser/infobars/infobar_service.h" 10 #include "chrome/browser/infobars/infobar_service.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 }; 53 };
54 54
55 class DownloadRequestLimiterTest : public ChromeRenderViewHostTestHarness { 55 class DownloadRequestLimiterTest : public ChromeRenderViewHostTestHarness {
56 public: 56 public:
57 enum TestingAction { 57 enum TestingAction {
58 ACCEPT, 58 ACCEPT,
59 CANCEL, 59 CANCEL,
60 WAIT 60 WAIT
61 }; 61 };
62 62
63 virtual void SetUp() { 63 void SetUp() override {
64 ChromeRenderViewHostTestHarness::SetUp(); 64 ChromeRenderViewHostTestHarness::SetUp();
65 InfoBarService::CreateForWebContents(web_contents()); 65 InfoBarService::CreateForWebContents(web_contents());
66 66
67 PermissionBubbleManager::CreateForWebContents(web_contents()); 67 PermissionBubbleManager::CreateForWebContents(web_contents());
68 view_.reset(new FakePermissionBubbleView(this)); 68 view_.reset(new FakePermissionBubbleView(this));
69 PermissionBubbleManager* manager = 69 PermissionBubbleManager* manager =
70 PermissionBubbleManager::FromWebContents(web_contents()); 70 PermissionBubbleManager::FromWebContents(web_contents());
71 manager->SetView(view_.get()); 71 manager->SetView(view_.get());
72 72
73 testing_action_ = ACCEPT; 73 testing_action_ = ACCEPT;
(...skipping 25 matching lines...) Expand all
99 host->Accept(); 99 host->Accept();
100 break; 100 break;
101 case CANCEL: 101 case CANCEL:
102 host->Cancel(); 102 host->Cancel();
103 break; 103 break;
104 case WAIT: 104 case WAIT:
105 break; 105 break;
106 } 106 }
107 } 107 }
108 108
109 virtual void TearDown() { 109 void TearDown() override {
110 content_settings_->ShutdownOnUIThread(); 110 content_settings_->ShutdownOnUIThread();
111 content_settings_ = NULL; 111 content_settings_ = NULL;
112 UnsetDelegate(); 112 UnsetDelegate();
113 ChromeRenderViewHostTestHarness::TearDown(); 113 ChromeRenderViewHostTestHarness::TearDown();
114 } 114 }
115 115
116 virtual void UnsetDelegate() { 116 virtual void UnsetDelegate() {
117 DownloadRequestInfoBarDelegate::SetCallbackForTesting(NULL); 117 DownloadRequestInfoBarDelegate::SetCallbackForTesting(NULL);
118 } 118 }
119 119
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 CanDownload(); 451 CanDownload();
452 ExpectAndResetCounts(0, 1, 0, __LINE__); 452 ExpectAndResetCounts(0, 1, 0, __LINE__);
453 ASSERT_EQ(DownloadRequestLimiter::PROMPT_BEFORE_DOWNLOAD, 453 ASSERT_EQ(DownloadRequestLimiter::PROMPT_BEFORE_DOWNLOAD,
454 download_request_limiter_->GetDownloadStatus(web_contents())); 454 download_request_limiter_->GetDownloadStatus(web_contents()));
455 455
456 CanDownload(); 456 CanDownload();
457 ExpectAndResetCounts(0, 1, 0, __LINE__); 457 ExpectAndResetCounts(0, 1, 0, __LINE__);
458 ASSERT_EQ(DownloadRequestLimiter::PROMPT_BEFORE_DOWNLOAD, 458 ASSERT_EQ(DownloadRequestLimiter::PROMPT_BEFORE_DOWNLOAD,
459 download_request_limiter_->GetDownloadStatus(web_contents())); 459 download_request_limiter_->GetDownloadStatus(web_contents()));
460 } 460 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698