| 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 "content/shell/common/webkit_test_helpers.h" | 5 #include "content/shell/common/webkit_test_helpers.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 prefs->smart_insert_delete_enabled = true; | 107 prefs->smart_insert_delete_enabled = true; |
| 108 prefs->minimum_accelerated_2d_canvas_size = 0; | 108 prefs->minimum_accelerated_2d_canvas_size = 0; |
| 109 #if defined(OS_ANDROID) | 109 #if defined(OS_ANDROID) |
| 110 prefs->text_autosizing_enabled = false; | 110 prefs->text_autosizing_enabled = false; |
| 111 #endif | 111 #endif |
| 112 } | 112 } |
| 113 | 113 |
| 114 base::FilePath GetWebKitRootDirFilePath() { | 114 base::FilePath GetWebKitRootDirFilePath() { |
| 115 base::FilePath base_path; | 115 base::FilePath base_path; |
| 116 PathService::Get(base::DIR_SOURCE_ROOT, &base_path); | 116 PathService::Get(base::DIR_SOURCE_ROOT, &base_path); |
| 117 if (file_util::PathExists( | 117 if (base::PathExists( |
| 118 base_path.Append(FILE_PATH_LITERAL("third_party/WebKit")))) { | 118 base_path.Append(FILE_PATH_LITERAL("third_party/WebKit")))) { |
| 119 // We're in a WebKit-in-chrome checkout. | 119 // We're in a WebKit-in-chrome checkout. |
| 120 return base_path.Append(FILE_PATH_LITERAL("third_party/WebKit")); | 120 return base_path.Append(FILE_PATH_LITERAL("third_party/WebKit")); |
| 121 } else if (file_util::PathExists( | 121 } else if (base::PathExists( |
| 122 base_path.Append(FILE_PATH_LITERAL("chromium")))) { | 122 base_path.Append(FILE_PATH_LITERAL("chromium")))) { |
| 123 // We're in a WebKit-only checkout on Windows. | 123 // We're in a WebKit-only checkout on Windows. |
| 124 return base_path.Append(FILE_PATH_LITERAL("../..")); | 124 return base_path.Append(FILE_PATH_LITERAL("../..")); |
| 125 } else if (file_util::PathExists( | 125 } else if (base::PathExists( |
| 126 base_path.Append(FILE_PATH_LITERAL("webkit/support")))) { | 126 base_path.Append(FILE_PATH_LITERAL("webkit/support")))) { |
| 127 // We're in a WebKit-only/xcodebuild checkout on Mac | 127 // We're in a WebKit-only/xcodebuild checkout on Mac |
| 128 return base_path.Append(FILE_PATH_LITERAL("../../..")); | 128 return base_path.Append(FILE_PATH_LITERAL("../../..")); |
| 129 } | 129 } |
| 130 // We're in a WebKit-only, make-build, so the DIR_SOURCE_ROOT is already the | 130 // We're in a WebKit-only, make-build, so the DIR_SOURCE_ROOT is already the |
| 131 // WebKit root. That, or we have no idea where we are. | 131 // WebKit root. That, or we have no idea where we are. |
| 132 return base_path; | 132 return base_path; |
| 133 } | 133 } |
| 134 | 134 |
| 135 base::FilePath GetChromiumRootDirFilePath() { | 135 base::FilePath GetChromiumRootDirFilePath() { |
| 136 base::FilePath webkit_path = GetWebKitRootDirFilePath(); | 136 base::FilePath webkit_path = GetWebKitRootDirFilePath(); |
| 137 if (file_util::PathExists(webkit_path.Append( | 137 if (base::PathExists(webkit_path.Append( |
| 138 FILE_PATH_LITERAL("Source/WebKit/chromium/webkit/support")))) { | 138 FILE_PATH_LITERAL("Source/WebKit/chromium/webkit/support")))) { |
| 139 // We're in a WebKit-only checkout. | 139 // We're in a WebKit-only checkout. |
| 140 return webkit_path.Append(FILE_PATH_LITERAL("Source/WebKit/chromium")); | 140 return webkit_path.Append(FILE_PATH_LITERAL("Source/WebKit/chromium")); |
| 141 } else { | 141 } else { |
| 142 // We're in a Chromium checkout, and WebKit is in third_party/WebKit. | 142 // We're in a Chromium checkout, and WebKit is in third_party/WebKit. |
| 143 return webkit_path.Append(FILE_PATH_LITERAL("../..")); | 143 return webkit_path.Append(FILE_PATH_LITERAL("../..")); |
| 144 } | 144 } |
| 145 } | 145 } |
| 146 | 146 |
| 147 } // namespace content | 147 } // namespace content |
| OLD | NEW |