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

Side by Side Diff: ui/views/mus/aura_init.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "ui/views/mus/aura_init.h" 5 #include "ui/views/mus/aura_init.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 if (ui::ResourceBundle::HasSharedInstance()) 103 if (ui::ResourceBundle::HasSharedInstance())
104 return; 104 return;
105 105
106 std::set<std::string> resource_paths({resource_file_}); 106 std::set<std::string> resource_paths({resource_file_});
107 if (!resource_file_200_.empty()) 107 if (!resource_file_200_.empty())
108 resource_paths.insert(resource_file_200_); 108 resource_paths.insert(resource_file_200_);
109 109
110 catalog::ResourceLoader loader; 110 catalog::ResourceLoader loader;
111 filesystem::mojom::DirectoryPtr directory; 111 filesystem::mojom::DirectoryPtr directory;
112 connector->BindInterface(catalog::mojom::kServiceName, &directory); 112 connector->BindInterface(catalog::mojom::kServiceName, &directory);
113 CHECK(loader.OpenFiles(std::move(directory), resource_paths)); 113 if (!loader.OpenFiles(std::move(directory), resource_paths)) {
sky 2017/05/12 17:16:47 Same comment here.
114 LOG(ERROR) << "AuraInit failed to open resource files.\n";
115 return;
116 }
117
114 ui::RegisterPathProvider(); 118 ui::RegisterPathProvider();
115 base::File pak_file = loader.TakeFile(resource_file_); 119 base::File pak_file = loader.TakeFile(resource_file_);
116 base::File pak_file_2 = pak_file.Duplicate(); 120 base::File pak_file_2 = pak_file.Duplicate();
117 ui::ResourceBundle::InitSharedInstanceWithPakFileRegion( 121 ui::ResourceBundle::InitSharedInstanceWithPakFileRegion(
118 std::move(pak_file), base::MemoryMappedFile::Region::kWholeFile); 122 std::move(pak_file), base::MemoryMappedFile::Region::kWholeFile);
119 ui::ResourceBundle::GetSharedInstance().AddDataPackFromFile( 123 ui::ResourceBundle::GetSharedInstance().AddDataPackFromFile(
120 std::move(pak_file_2), ui::SCALE_FACTOR_100P); 124 std::move(pak_file_2), ui::SCALE_FACTOR_100P);
121 if (!resource_file_200_.empty()) 125 if (!resource_file_200_.empty())
122 ui::ResourceBundle::GetSharedInstance().AddDataPackFromFile( 126 ui::ResourceBundle::GetSharedInstance().AddDataPackFromFile(
123 loader.TakeFile(resource_file_200_), ui::SCALE_FACTOR_200P); 127 loader.TakeFile(resource_file_200_), ui::SCALE_FACTOR_200P);
124 } 128 }
125 129
126 } // namespace views 130 } // namespace views
OLDNEW
« services/ui/service.cc ('K') | « testing/buildbot/filters/mash.browser_tests.filter ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698