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

Side by Side Diff: services/ui/service.cc

Issue 2858103002: Have mash_browser_tests recreate BackgroundServiceManager per test (Closed)
Patch Set: Disable broken tests Created 3 years, 7 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 "services/ui/service.h" 5 #include "services/ui/service.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 return; 104 return;
105 105
106 std::set<std::string> resource_paths; 106 std::set<std::string> resource_paths;
107 resource_paths.insert(kResourceFileStrings); 107 resource_paths.insert(kResourceFileStrings);
108 resource_paths.insert(kResourceFile100); 108 resource_paths.insert(kResourceFile100);
109 resource_paths.insert(kResourceFile200); 109 resource_paths.insert(kResourceFile200);
110 110
111 catalog::ResourceLoader loader; 111 catalog::ResourceLoader loader;
112 filesystem::mojom::DirectoryPtr directory; 112 filesystem::mojom::DirectoryPtr directory;
113 connector->BindInterface(catalog::mojom::kServiceName, &directory); 113 connector->BindInterface(catalog::mojom::kServiceName, &directory);
114 CHECK(loader.OpenFiles(std::move(directory), resource_paths)); 114 if (!loader.OpenFiles(std::move(directory), resource_paths)) {
sky 2017/05/12 17:16:47 The reason this CHECKs is because to do otherwise
jonross 2017/05/12 18:08:02 There appears to be a race on short run tests whic
115 LOG(ERROR) << "Service failed to open resource files.\n";
116 return;
117 }
115 118
116 ui::RegisterPathProvider(); 119 ui::RegisterPathProvider();
117 120
118 // Initialize resource bundle with 1x and 2x cursor bitmaps. 121 // Initialize resource bundle with 1x and 2x cursor bitmaps.
119 ui::ResourceBundle::InitSharedInstanceWithPakFileRegion( 122 ui::ResourceBundle::InitSharedInstanceWithPakFileRegion(
120 loader.TakeFile(kResourceFileStrings), 123 loader.TakeFile(kResourceFileStrings),
121 base::MemoryMappedFile::Region::kWholeFile); 124 base::MemoryMappedFile::Region::kWholeFile);
122 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 125 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
123 rb.AddDataPackFromFile(loader.TakeFile(kResourceFile100), 126 rb.AddDataPackFromFile(loader.TakeFile(kResourceFile100),
124 ui::SCALE_FACTOR_100P); 127 ui::SCALE_FACTOR_100P);
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 mojom::WindowServerTestRequest request) { 424 mojom::WindowServerTestRequest request) {
422 if (!test_config_) 425 if (!test_config_)
423 return; 426 return;
424 mojo::MakeStrongBinding( 427 mojo::MakeStrongBinding(
425 base::MakeUnique<ws::WindowServerTestImpl>(window_server_.get()), 428 base::MakeUnique<ws::WindowServerTestImpl>(window_server_.get()),
426 std::move(request)); 429 std::move(request));
427 } 430 }
428 431
429 432
430 } // namespace ui 433 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698