OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "webkit/tools/test_shell/test_shell.h" | 5 #include "webkit/tools/test_shell/test_shell.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <fcntl.h> | 8 #include <fcntl.h> |
9 #include <fontconfig/fontconfig.h> | 9 #include <fontconfig/fontconfig.h> |
10 #include <gtk/gtk.h> | 10 #include <gtk/gtk.h> |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 bool allow_external_pages) { | 155 bool allow_external_pages) { |
156 window_list_ = new WindowList; | 156 window_list_ = new WindowList; |
157 layout_test_mode_ = layout_test_mode; | 157 layout_test_mode_ = layout_test_mode; |
158 allow_external_pages_ = allow_external_pages; | 158 allow_external_pages_ = allow_external_pages; |
159 | 159 |
160 web_prefs_ = new webkit_glue::WebPreferences; | 160 web_prefs_ = new webkit_glue::WebPreferences; |
161 | 161 |
162 FilePath data_path; | 162 FilePath data_path; |
163 PathService::Get(base::DIR_EXE, &data_path); | 163 PathService::Get(base::DIR_EXE, &data_path); |
164 data_path = data_path.Append("test_shell.pak"); | 164 data_path = data_path.Append("test_shell.pak"); |
165 ResourceBundle::InitSharedInstanceWithPakFile(data_path); | 165 ResourceBundle::InitSharedInstanceWithPakPath(data_path); |
166 | 166 |
167 FilePath resources_dir; | 167 FilePath resources_dir; |
168 PathService::Get(base::DIR_SOURCE_ROOT, &resources_dir); | 168 PathService::Get(base::DIR_SOURCE_ROOT, &resources_dir); |
169 resources_dir = resources_dir.Append("webkit/tools/test_shell/resources"); | 169 resources_dir = resources_dir.Append("webkit/tools/test_shell/resources"); |
170 | 170 |
171 ResetWebPreferences(); | 171 ResetWebPreferences(); |
172 | 172 |
173 // We wish to make the layout tests reproducable with respect to fonts. Skia | 173 // We wish to make the layout tests reproducable with respect to fonts. Skia |
174 // uses fontconfig to resolve font family names from WebKit into actual font | 174 // uses fontconfig to resolve font family names from WebKit into actual font |
175 // files found on the current system. This means that fonts vary based on the | 175 // files found on the current system. This means that fonts vary based on the |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
577 case IDR_BROKENIMAGE: | 577 case IDR_BROKENIMAGE: |
578 resource_id = IDR_BROKENIMAGE_TESTSHELL; | 578 resource_id = IDR_BROKENIMAGE_TESTSHELL; |
579 break; | 579 break; |
580 case IDR_TEXTAREA_RESIZER: | 580 case IDR_TEXTAREA_RESIZER: |
581 resource_id = IDR_TEXTAREA_RESIZER_TESTSHELL; | 581 resource_id = IDR_TEXTAREA_RESIZER_TESTSHELL; |
582 break; | 582 break; |
583 } | 583 } |
584 // TODO(flackr): Pass scale_factor. | 584 // TODO(flackr): Pass scale_factor. |
585 return TestShell::ResourceProvider(resource_id); | 585 return TestShell::ResourceProvider(resource_id); |
586 } | 586 } |
OLD | NEW |