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

Side by Side Diff: webkit/tools/test_shell/test_shell_mac.mm

Issue 5992006: Move data pack from base to app (it's just part of the resource bundle system... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years 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 | Annotate | Revision Log
« no previous file with comments | « webkit/tools/test_shell/test_shell_gtk.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 <ApplicationServices/ApplicationServices.h> 5 #include <ApplicationServices/ApplicationServices.h>
6 #import <Cocoa/Cocoa.h> 6 #import <Cocoa/Cocoa.h>
7 #import <objc/objc-runtime.h> 7 #import <objc/objc-runtime.h>
8 #include <sys/stat.h> 8 #include <sys/stat.h>
9 9
10 #include "webkit/tools/test_shell/test_shell.h" 10 #include "webkit/tools/test_shell/test_shell.h"
11 11
12 #include "app/data_pack.h"
12 #include "base/base_paths.h" 13 #include "base/base_paths.h"
13 #include "base/basictypes.h" 14 #include "base/basictypes.h"
14 #include "base/data_pack.h"
15 #include "base/debug_on_start.h" 15 #include "base/debug_on_start.h"
16 #include "base/debug/debugger.h" 16 #include "base/debug/debugger.h"
17 #include "base/file_path.h" 17 #include "base/file_path.h"
18 #include "base/file_util.h" 18 #include "base/file_util.h"
19 #include "base/logging.h" 19 #include "base/logging.h"
20 #include "base/mac_util.h" 20 #include "base/mac_util.h"
21 #include "base/memory_debug.h" 21 #include "base/memory_debug.h"
22 #include "base/message_loop.h" 22 #include "base/message_loop.h"
23 #include "base/path_service.h" 23 #include "base/path_service.h"
24 #include "base/string16.h" 24 #include "base/string16.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 // The W3C SVG layout tests use a different size than the other layout tests 63 // The W3C SVG layout tests use a different size than the other layout tests
64 const int kSVGTestWindowWidth = 480; 64 const int kSVGTestWindowWidth = 480;
65 const int kSVGTestWindowHeight = 360; 65 const int kSVGTestWindowHeight = 360;
66 66
67 // Hide the window offscreen when in layout test mode. Mac OS X limits 67 // Hide the window offscreen when in layout test mode. Mac OS X limits
68 // window positions to +/- 16000. 68 // window positions to +/- 16000.
69 const int kTestWindowXLocation = -14000; 69 const int kTestWindowXLocation = -14000;
70 const int kTestWindowYLocation = -14000; 70 const int kTestWindowYLocation = -14000;
71 71
72 // Data pack resource. This is a pointer to the mmapped resources file. 72 // Data pack resource. This is a pointer to the mmapped resources file.
73 static base::DataPack* g_resource_data_pack = NULL; 73 static app::DataPack* g_resource_data_pack = NULL;
74 74
75 // Define static member variables 75 // Define static member variables
76 base::LazyInstance <std::map<gfx::NativeWindow, TestShell *> > 76 base::LazyInstance <std::map<gfx::NativeWindow, TestShell *> >
77 TestShell::window_map_(base::LINKER_INITIALIZED); 77 TestShell::window_map_(base::LINKER_INITIALIZED);
78 78
79 // Helper method for getting the path to the test shell resources directory. 79 // Helper method for getting the path to the test shell resources directory.
80 FilePath GetResourcesFilePath() { 80 FilePath GetResourcesFilePath() {
81 FilePath path; 81 FilePath path;
82 // We need to know if we're bundled or not to know which path to use. 82 // We need to know if we're bundled or not to know which path to use.
83 if (mac_util::AmIBundled()) { 83 if (mac_util::AmIBundled()) {
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 203
204 window_list_ = new WindowList; 204 window_list_ = new WindowList;
205 layout_test_mode_ = layout_test_mode; 205 layout_test_mode_ = layout_test_mode;
206 allow_external_pages_ = allow_external_pages; 206 allow_external_pages_ = allow_external_pages;
207 207
208 web_prefs_ = new WebPreferences; 208 web_prefs_ = new WebPreferences;
209 209
210 // mmap the data pack which holds strings used by WebCore. This is only 210 // mmap the data pack which holds strings used by WebCore. This is only
211 // a fatal error if we're bundled, which means we might be running layout 211 // a fatal error if we're bundled, which means we might be running layout
212 // tests. This is a harmless failure for test_shell_tests. 212 // tests. This is a harmless failure for test_shell_tests.
213 g_resource_data_pack = new base::DataPack; 213 g_resource_data_pack = new app::DataPack;
214 NSString *resource_path = 214 NSString *resource_path =
215 [mac_util::MainAppBundle() pathForResource:@"test_shell" 215 [mac_util::MainAppBundle() pathForResource:@"test_shell"
216 ofType:@"pak"]; 216 ofType:@"pak"];
217 FilePath resources_pak_path([resource_path fileSystemRepresentation]); 217 FilePath resources_pak_path([resource_path fileSystemRepresentation]);
218 if (!g_resource_data_pack->Load(resources_pak_path)) { 218 if (!g_resource_data_pack->Load(resources_pak_path)) {
219 LOG(FATAL) << "failed to load test_shell.pak"; 219 LOG(FATAL) << "failed to load test_shell.pak";
220 } 220 }
221 221
222 ResetWebPreferences(); 222 ResetWebPreferences();
223 223
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
735 return false; 735 return false;
736 } 736 }
737 737
738 void DidLoadPlugin(const std::string& filename) { 738 void DidLoadPlugin(const std::string& filename) {
739 } 739 }
740 740
741 void DidUnloadPlugin(const std::string& filename) { 741 void DidUnloadPlugin(const std::string& filename) {
742 } 742 }
743 743
744 } // namespace webkit_glue 744 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « webkit/tools/test_shell/test_shell_gtk.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698