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/support/platform_support.h" | 5 #include "webkit/support/platform_support.h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 net::android::RegisterNetworkLibrary(env); | 46 net::android::RegisterNetworkLibrary(env); |
47 } | 47 } |
48 } | 48 } |
49 | 49 |
50 void AfterInitialize(bool unit_test_mode) { | 50 void AfterInitialize(bool unit_test_mode) { |
51 if (unit_test_mode) | 51 if (unit_test_mode) |
52 return; // We don't have a resource pack when running the unit-tests. | 52 return; // We don't have a resource pack when running the unit-tests. |
53 | 53 |
54 FilePath data_path(kDumpRenderTreeDir); | 54 FilePath data_path(kDumpRenderTreeDir); |
55 data_path = data_path.Append("DumpRenderTree.pak"); | 55 data_path = data_path.Append("DumpRenderTree.pak"); |
56 ResourceBundle::InitSharedInstanceWithPakFile(data_path); | 56 ResourceBundle::InitSharedInstanceWithPakPath(data_path); |
57 | 57 |
58 // We enable file-over-http to bridge the file protocol to http protocol | 58 // We enable file-over-http to bridge the file protocol to http protocol |
59 // in here, which can | 59 // in here, which can |
60 // (1) run the layout tests on android target device, but never need to | 60 // (1) run the layout tests on android target device, but never need to |
61 // push the test files and corresponding resources to device, which saves | 61 // push the test files and corresponding resources to device, which saves |
62 // huge running time. | 62 // huge running time. |
63 // (2) still run non-http layout (tests not under LayoutTests/http) tests | 63 // (2) still run non-http layout (tests not under LayoutTests/http) tests |
64 // via file protocol without breaking test environment / convention of webkit | 64 // via file protocol without breaking test environment / convention of webkit |
65 // layout tests, which are followed by current all webkit ports. | 65 // layout tests, which are followed by current all webkit ports. |
66 SimpleResourceLoaderBridge::AllowFileOverHTTP( | 66 SimpleResourceLoaderBridge::AllowFileOverHTTP( |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 if (!success) | 105 if (!success) |
106 LOG(FATAL) << "Failed reading: " << path.value(); | 106 LOG(FATAL) << "Failed reading: " << path.value(); |
107 } | 107 } |
108 return resize_corner_data; | 108 return resize_corner_data; |
109 } | 109 } |
110 } | 110 } |
111 | 111 |
112 return ResourceBundle::GetSharedInstance().GetRawDataResource( | 112 return ResourceBundle::GetSharedInstance().GetRawDataResource( |
113 resource_id, scale_factor); | 113 resource_id, scale_factor); |
114 } | 114 } |
OLD | NEW |