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

Side by Side Diff: chrome/browser/bitmap_fetcher/bitmap_fetcher_browsertest.cc

Issue 648653003: Standardize usage of virtual/override/final in chrome/browser/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/bitmap_fetcher/bitmap_fetcher.h" 5 #include "chrome/browser/bitmap_fetcher/bitmap_fetcher.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/ui/browser.h" 9 #include "chrome/browser/ui/browser.h"
10 #include "chrome/test/base/in_process_browser_test.h" 10 #include "chrome/test/base/in_process_browser_test.h"
(...skipping 14 matching lines...) Expand all
25 25
26 namespace chrome { 26 namespace chrome {
27 27
28 // Class to catch events from the BitmapFetcher for testing. 28 // Class to catch events from the BitmapFetcher for testing.
29 class BitmapFetcherTestDelegate : public BitmapFetcherDelegate { 29 class BitmapFetcherTestDelegate : public BitmapFetcherDelegate {
30 public: 30 public:
31 explicit BitmapFetcherTestDelegate(bool async) : called_(false), 31 explicit BitmapFetcherTestDelegate(bool async) : called_(false),
32 success_(false), 32 success_(false),
33 async_(async) {} 33 async_(async) {}
34 34
35 virtual ~BitmapFetcherTestDelegate() { 35 ~BitmapFetcherTestDelegate() override { EXPECT_TRUE(called_); }
36 EXPECT_TRUE(called_);
37 }
38 36
39 // Method inherited from BitmapFetcherDelegate. 37 // Method inherited from BitmapFetcherDelegate.
40 virtual void OnFetchComplete(const GURL url, 38 void OnFetchComplete(const GURL url, const SkBitmap* bitmap) override {
41 const SkBitmap* bitmap) override {
42 called_ = true; 39 called_ = true;
43 url_ = url; 40 url_ = url;
44 if (bitmap) { 41 if (bitmap) {
45 success_ = true; 42 success_ = true;
46 bitmap->deepCopyTo(&bitmap_); 43 bitmap->deepCopyTo(&bitmap_);
47 } 44 }
48 // For async calls, we need to quit the run loop so the test can continue. 45 // For async calls, we need to quit the run loop so the test can continue.
49 if (async_) 46 if (async_)
50 run_loop_.Quit(); 47 run_loop_.Quit();
51 } 48 }
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 net::URLRequest::CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE, 192 net::URLRequest::CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE,
196 net::LOAD_NORMAL); 193 net::LOAD_NORMAL);
197 194
198 // Blocks until test delegate is notified via a callback. 195 // Blocks until test delegate is notified via a callback.
199 delegate.Wait(); 196 delegate.Wait();
200 197
201 EXPECT_FALSE(delegate.success()); 198 EXPECT_FALSE(delegate.success());
202 } 199 }
203 200
204 } // namespace chrome 201 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/bitmap_fetcher/bitmap_fetcher.h ('k') | chrome/browser/bitmap_fetcher/bitmap_fetcher_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698