| OLD | NEW |
| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/search/suggestions/proto/suggestions.pb.h" | 10 #include "chrome/browser/search/suggestions/proto/suggestions.pb.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 | 57 |
| 58 virtual void TearDownInProcessBrowserTestFixture() OVERRIDE { | 58 virtual void TearDownInProcessBrowserTestFixture() OVERRIDE { |
| 59 test_server_.Stop(); | 59 test_server_.Stop(); |
| 60 } | 60 } |
| 61 | 61 |
| 62 virtual void SetUpOnMainThread() OVERRIDE { | 62 virtual void SetUpOnMainThread() OVERRIDE { |
| 63 fake_db_ = new FakeDB<ThumbnailData>(&db_model_); | 63 fake_db_ = new FakeDB<ThumbnailData>(&db_model_); |
| 64 thumbnail_manager_.reset(CreateThumbnailManager(fake_db_)); | 64 thumbnail_manager_.reset(CreateThumbnailManager(fake_db_)); |
| 65 } | 65 } |
| 66 | 66 |
| 67 virtual void CleanUpOnMainThread() OVERRIDE { | 67 virtual void TearDownOnMainThread() OVERRIDE { |
| 68 fake_db_ = NULL; | 68 fake_db_ = NULL; |
| 69 db_model_.clear(); | 69 db_model_.clear(); |
| 70 thumbnail_manager_.reset(); | 70 thumbnail_manager_.reset(); |
| 71 test_thumbnail_manager_.reset(); | 71 test_thumbnail_manager_.reset(); |
| 72 } | 72 } |
| 73 | 73 |
| 74 void InitializeTestBitmapData() { | 74 void InitializeTestBitmapData() { |
| 75 FakeDB<ThumbnailData>* test_fake_db = new FakeDB<ThumbnailData>(&db_model_); | 75 FakeDB<ThumbnailData>* test_fake_db = new FakeDB<ThumbnailData>(&db_model_); |
| 76 test_thumbnail_manager_.reset(CreateThumbnailManager(test_fake_db)); | 76 test_thumbnail_manager_.reset(CreateThumbnailManager(test_fake_db)); |
| 77 | 77 |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 GURL(kTestUrl1), | 266 GURL(kTestUrl1), |
| 267 base::Bind(&ThumbnailManagerBrowserTest::OnThumbnailAvailable, | 267 base::Bind(&ThumbnailManagerBrowserTest::OnThumbnailAvailable, |
| 268 base::Unretained(this), &run_loop)); | 268 base::Unretained(this), &run_loop)); |
| 269 run_loop.Run(); | 269 run_loop.Run(); |
| 270 | 270 |
| 271 EXPECT_EQ(0, num_callback_null_called_); | 271 EXPECT_EQ(0, num_callback_null_called_); |
| 272 EXPECT_EQ(1, num_callback_valid_called_); | 272 EXPECT_EQ(1, num_callback_valid_called_); |
| 273 } | 273 } |
| 274 | 274 |
| 275 } // namespace suggestions | 275 } // namespace suggestions |
| OLD | NEW |