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

Side by Side Diff: chromeos/printing/ppd_provider_unittest.cc

Issue 2476073003: Update PpdProvider threading model. (Closed)
Patch Set: Change CHECK to DCHECK Created 4 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
« no previous file with comments | « chromeos/printing/ppd_provider.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/files/file_util.h" 6 #include "base/files/file_util.h"
7 #include "base/files/scoped_temp_dir.h" 7 #include "base/files/scoped_temp_dir.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 PpdProviderTest() 67 PpdProviderTest()
68 : loop_(base::MessageLoop::TYPE_IO), 68 : loop_(base::MessageLoop::TYPE_IO),
69 request_context_getter_( 69 request_context_getter_(
70 new net::TestURLRequestContextGetter(loop_.task_runner().get())) {} 70 new net::TestURLRequestContextGetter(loop_.task_runner().get())) {}
71 71
72 void SetUp() override { 72 void SetUp() override {
73 ASSERT_TRUE(ppd_cache_temp_dir_.CreateUniqueTempDir()); 73 ASSERT_TRUE(ppd_cache_temp_dir_.CreateUniqueTempDir());
74 auto provider_options = PpdProvider::Options(); 74 auto provider_options = PpdProvider::Options();
75 provider_options.quirks_server = kTestQuirksServer; 75 provider_options.quirks_server = kTestQuirksServer;
76 ppd_provider_ = PpdProvider::Create( 76 ppd_provider_ = PpdProvider::Create(
77 kTestAPIKey, request_context_getter_, 77 kTestAPIKey, request_context_getter_.get(), loop_.task_runner().get(),
78 PpdCache::Create(ppd_cache_temp_dir_.GetPath()), provider_options); 78 PpdCache::Create(ppd_cache_temp_dir_.GetPath()), provider_options);
79 } 79 }
80 80
81 protected: 81 protected:
82 base::ScopedTempDir ppd_cache_temp_dir_; 82 base::ScopedTempDir ppd_cache_temp_dir_;
83 83
84 // Provider to be used in the test. 84 // Provider to be used in the test.
85 std::unique_ptr<PpdProvider> ppd_provider_; 85 std::unique_ptr<PpdProvider> ppd_provider_;
86 86
87 // Misc extra stuff needed for the test environment to function. 87 // Misc extra stuff needed for the test environment to function.
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 available_printers.clear(); 255 available_printers.clear();
256 ppd_provider_->QueryAvailable(query_callback); 256 ppd_provider_->QueryAvailable(query_callback);
257 base::RunLoop().RunUntilIdle(); 257 base::RunLoop().RunUntilIdle();
258 EXPECT_EQ(PpdProvider::SUCCESS, result_code); 258 EXPECT_EQ(PpdProvider::SUCCESS, result_code);
259 EXPECT_EQ(QuirksPrinters(), available_printers); 259 EXPECT_EQ(QuirksPrinters(), available_printers);
260 } 260 }
261 261
262 } // namespace 262 } // namespace
263 } // namespace printing 263 } // namespace printing
264 } // namespace chromeos 264 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/printing/ppd_provider.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698