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

Side by Side Diff: components/printing/service/test_service_main.cc

Issue 2919823004: Add error handling and unit test for pdf compositor service (Closed)
Patch Set: rebase Created 3 years, 4 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
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "base/test/test_discardable_memory_allocator.h"
6 #include "components/printing/service/pdf_compositor_service.h"
7 #include "services/service_manager/public/c/main.h"
8 #include "services/service_manager/public/cpp/service_runner.h"
9
10 // In order to test PdfCompositorService, this class overrides and
11 // uses a test discardable memory allocator.
12 class PdfCompositorTestService : public printing::PdfCompositorService {
13 public:
14 explicit PdfCompositorTestService(const std::string& creator)
15 : PdfCompositorService(creator) {}
16 ~PdfCompositorTestService() override {}
17
18 // PdfCompositorService:
19 void PrepareToStart() override;
20
21 private:
22 base::TestDiscardableMemoryAllocator mem_allocator_;
23 };
24
25 void PdfCompositorTestService::PrepareToStart() {
26 base::DiscardableMemoryAllocator::SetInstance(&mem_allocator_);
27 }
28
29 MojoResult ServiceMain(MojoHandle service_request_handle) {
30 service_manager::ServiceRunner runner(
31 new PdfCompositorTestService("pdf_compositor_service_unittest"));
32 return runner.Run(service_request_handle);
33 }
OLDNEW
« no previous file with comments | « components/printing/service/public/interfaces/pdf_compositor.mojom ('k') | components/test/data/printing/google.mskp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698