| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "chrome/test/perf/perf_ui_test_suite.h" | 5 #include "chrome/test/perf/perf_ui_test_suite.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/json/json_file_value_serializer.h" | 8 #include "base/json/json_file_value_serializer.h" |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 serializer.Deserialize(&error_code, &error))); | 146 serializer.Deserialize(&error_code, &error))); |
| 147 if (error_code != 0 || !valid_value) | 147 if (error_code != 0 || !valid_value) |
| 148 LOG(FATAL) << "Error parsing theme manifest: " << error; | 148 LOG(FATAL) << "Error parsing theme manifest: " << error; |
| 149 | 149 |
| 150 scoped_refptr<Extension> extension = | 150 scoped_refptr<Extension> extension = |
| 151 Extension::Create(extension_base, | 151 Extension::Create(extension_base, |
| 152 extensions::Manifest::INVALID_LOCATION, | 152 extensions::Manifest::INVALID_LOCATION, |
| 153 *valid_value, | 153 *valid_value, |
| 154 Extension::NO_FLAGS, | 154 Extension::NO_FLAGS, |
| 155 &error); | 155 &error); |
| 156 if (!extension) | 156 if (!extension.get()) |
| 157 LOG(FATAL) << "Error loading theme extension: " << error; | 157 LOG(FATAL) << "Error loading theme extension: " << error; |
| 158 | 158 |
| 159 // Build the "Cached Theme.pak" file in the template. (It's not committed | 159 // Build the "Cached Theme.pak" file in the template. (It's not committed |
| 160 // both because committing large binary files is bad in a git world and | 160 // both because committing large binary files is bad in a git world and |
| 161 // because people don't remember to update it anyway, meaning we usually | 161 // because people don't remember to update it anyway, meaning we usually |
| 162 // have the theme rebuild penalty in our data.) | 162 // have the theme rebuild penalty in our data.) |
| 163 base::MessageLoopForUI message_loop_; | 163 base::MessageLoopForUI message_loop_; |
| 164 content::TestBrowserThread ui_thread_(BrowserThread::UI, &message_loop_); | 164 content::TestBrowserThread ui_thread_(BrowserThread::UI, &message_loop_); |
| 165 content::TestBrowserThread file_thread_(BrowserThread::FILE, | 165 content::TestBrowserThread file_thread_(BrowserThread::FILE, |
| 166 &message_loop_); | 166 &message_loop_); |
| 167 | 167 |
| 168 scoped_refptr<BrowserThemePack> theme( | 168 scoped_refptr<BrowserThemePack> theme( |
| 169 BrowserThemePack::BuildFromExtension(extension)); | 169 BrowserThemePack::BuildFromExtension(extension.get())); |
| 170 if (!theme) | 170 if (!theme.get()) |
| 171 LOG(FATAL) << "Failed to load theme from extension"; | 171 LOG(FATAL) << "Failed to load theme from extension"; |
| 172 | 172 |
| 173 theme->WriteToDisk(extension_base.AppendASCII("Cached Theme.pak")); | 173 theme->WriteToDisk(extension_base.AppendASCII("Cached Theme.pak")); |
| 174 } | 174 } |
| OLD | NEW |