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

Unified Diff: content/test/test_webkit_platform_support.cc

Issue 63253002: Rename WebKit namespace to blink (part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/test/test_webkit_platform_support.h ('k') | content/test/web_gesture_curve_mock.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/test_webkit_platform_support.cc
diff --git a/content/test/test_webkit_platform_support.cc b/content/test/test_webkit_platform_support.cc
index 4c9bf779a179fcbca0444fd5245fcac391c02d05..bc936586dc51ca98b5f5739b19f1e8b95bc93470 100644
--- a/content/test/test_webkit_platform_support.cc
+++ b/content/test/test_webkit_platform_support.cc
@@ -43,7 +43,7 @@
#include "base/mac/mac_util.h"
#endif
-using WebKit::WebScriptController;
+using blink::WebScriptController;
using webkit::WebLayerTreeViewImplForTesting;
namespace content {
@@ -53,21 +53,21 @@ TestWebKitPlatformSupport::TestWebKitPlatformSupport() {
mock_clipboard_.reset(new MockWebClipboardImpl());
v8::V8::SetCounterFunction(base::StatsTable::FindLocation);
- WebKit::initialize(this);
- WebKit::setLayoutTestMode(true);
- WebKit::WebSecurityPolicy::registerURLSchemeAsLocal(
- WebKit::WebString::fromUTF8("test-shell-resource"));
- WebKit::WebSecurityPolicy::registerURLSchemeAsNoAccess(
- WebKit::WebString::fromUTF8("test-shell-resource"));
- WebKit::WebSecurityPolicy::registerURLSchemeAsDisplayIsolated(
- WebKit::WebString::fromUTF8("test-shell-resource"));
- WebKit::WebSecurityPolicy::registerURLSchemeAsEmptyDocument(
- WebKit::WebString::fromUTF8("test-shell-resource"));
+ blink::initialize(this);
+ blink::setLayoutTestMode(true);
+ blink::WebSecurityPolicy::registerURLSchemeAsLocal(
+ blink::WebString::fromUTF8("test-shell-resource"));
+ blink::WebSecurityPolicy::registerURLSchemeAsNoAccess(
+ blink::WebString::fromUTF8("test-shell-resource"));
+ blink::WebSecurityPolicy::registerURLSchemeAsDisplayIsolated(
+ blink::WebString::fromUTF8("test-shell-resource"));
+ blink::WebSecurityPolicy::registerURLSchemeAsEmptyDocument(
+ blink::WebString::fromUTF8("test-shell-resource"));
WebScriptController::enableV8SingleThreadMode();
- WebKit::WebRuntimeFeatures::enableApplicationCache(true);
- WebKit::WebRuntimeFeatures::enableDatabase(true);
- WebKit::WebRuntimeFeatures::enableNotifications(true);
- WebKit::WebRuntimeFeatures::enableTouch(true);
+ blink::WebRuntimeFeatures::enableApplicationCache(true);
+ blink::WebRuntimeFeatures::enableDatabase(true);
+ blink::WebRuntimeFeatures::enableNotifications(true);
+ blink::WebRuntimeFeatures::enableTouch(true);
// Load libraries for media and enable the media player.
bool enable_media = false;
@@ -80,12 +80,12 @@ TestWebKitPlatformSupport::TestWebKitPlatformSupport() {
if (media::InitializeMediaLibrary(module_path))
enable_media = true;
}
- WebKit::WebRuntimeFeatures::enableMediaPlayer(enable_media);
+ blink::WebRuntimeFeatures::enableMediaPlayer(enable_media);
LOG_IF(WARNING, !enable_media) << "Failed to initialize the media library.\n";
// TODO(joth): Make a dummy geolocation service implemenation for
// test_shell, and set this to true. http://crbug.com/36451
- WebKit::WebRuntimeFeatures::enableGeolocation(false);
+ blink::WebRuntimeFeatures::enableGeolocation(false);
file_utilities_.set_sandbox_enabled(false);
@@ -109,35 +109,35 @@ TestWebKitPlatformSupport::TestWebKitPlatformSupport() {
TestWebKitPlatformSupport::~TestWebKitPlatformSupport() {
url_loader_factory_.reset();
mock_clipboard_.reset();
- WebKit::shutdown();
+ blink::shutdown();
}
-WebKit::WebMimeRegistry* TestWebKitPlatformSupport::mimeRegistry() {
+blink::WebMimeRegistry* TestWebKitPlatformSupport::mimeRegistry() {
return &mime_registry_;
}
-WebKit::WebClipboard* TestWebKitPlatformSupport::clipboard() {
+blink::WebClipboard* TestWebKitPlatformSupport::clipboard() {
// Mock out clipboard calls so that tests don't mess
// with each other's copies/pastes when running in parallel.
return mock_clipboard_.get();
}
-WebKit::WebFileUtilities* TestWebKitPlatformSupport::fileUtilities() {
+blink::WebFileUtilities* TestWebKitPlatformSupport::fileUtilities() {
return &file_utilities_;
}
-WebKit::WebIDBFactory* TestWebKitPlatformSupport::idbFactory() {
+blink::WebIDBFactory* TestWebKitPlatformSupport::idbFactory() {
NOTREACHED() <<
"IndexedDB cannot be tested with in-process harnesses.";
return NULL;
}
-WebKit::WebURLLoader* TestWebKitPlatformSupport::createURLLoader() {
+blink::WebURLLoader* TestWebKitPlatformSupport::createURLLoader() {
return url_loader_factory_->CreateURLLoader(
webkit_glue::WebKitPlatformSupportImpl::createURLLoader());
}
-WebKit::WebData TestWebKitPlatformSupport::loadResource(const char* name) {
+blink::WebData TestWebKitPlatformSupport::loadResource(const char* name) {
if (!strcmp(name, "deleteButton")) {
// Create a red 30x30 square.
const char red_square[] =
@@ -152,75 +152,75 @@ WebKit::WebData TestWebKitPlatformSupport::loadResource(const char* name) {
"\x18\x50\xb9\x33\x47\xf9\xa8\x01\x32\xd4\xc2\x03\x00\x33\x84\x0d"
"\x02\x3a\x91\xeb\xa5\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60"
"\x82";
- return WebKit::WebData(red_square, arraysize(red_square));
+ return blink::WebData(red_square, arraysize(red_square));
}
return webkit_glue::WebKitPlatformSupportImpl::loadResource(name);
}
-WebKit::WebString TestWebKitPlatformSupport::queryLocalizedString(
- WebKit::WebLocalizedString::Name name) {
+blink::WebString TestWebKitPlatformSupport::queryLocalizedString(
+ blink::WebLocalizedString::Name name) {
// Returns placeholder strings to check if they are correctly localized.
switch (name) {
- case WebKit::WebLocalizedString::OtherDateLabel:
+ case blink::WebLocalizedString::OtherDateLabel:
return ASCIIToUTF16("<<OtherDateLabel>>");
- case WebKit::WebLocalizedString::OtherMonthLabel:
+ case blink::WebLocalizedString::OtherMonthLabel:
return ASCIIToUTF16("<<OtherMonthLabel>>");
- case WebKit::WebLocalizedString::OtherTimeLabel:
+ case blink::WebLocalizedString::OtherTimeLabel:
return ASCIIToUTF16("<<OtherTimeLabel>>");
- case WebKit::WebLocalizedString::OtherWeekLabel:
+ case blink::WebLocalizedString::OtherWeekLabel:
return ASCIIToUTF16("<<OtherWeekLabel>>");
- case WebKit::WebLocalizedString::CalendarClear:
+ case blink::WebLocalizedString::CalendarClear:
return ASCIIToUTF16("<<CalendarClear>>");
- case WebKit::WebLocalizedString::CalendarToday:
+ case blink::WebLocalizedString::CalendarToday:
return ASCIIToUTF16("<<CalendarToday>>");
- case WebKit::WebLocalizedString::ThisMonthButtonLabel:
+ case blink::WebLocalizedString::ThisMonthButtonLabel:
return ASCIIToUTF16("<<ThisMonthLabel>>");
- case WebKit::WebLocalizedString::ThisWeekButtonLabel:
+ case blink::WebLocalizedString::ThisWeekButtonLabel:
return ASCIIToUTF16("<<ThisWeekLabel>>");
- case WebKit::WebLocalizedString::WeekFormatTemplate:
+ case blink::WebLocalizedString::WeekFormatTemplate:
return ASCIIToUTF16("Week $2, $1");
default:
return WebKitPlatformSupportImpl::queryLocalizedString(name);
}
}
-WebKit::WebString TestWebKitPlatformSupport::queryLocalizedString(
- WebKit::WebLocalizedString::Name name,
- const WebKit::WebString& value) {
- if (name == WebKit::WebLocalizedString::ValidationRangeUnderflow)
+blink::WebString TestWebKitPlatformSupport::queryLocalizedString(
+ blink::WebLocalizedString::Name name,
+ const blink::WebString& value) {
+ if (name == blink::WebLocalizedString::ValidationRangeUnderflow)
return ASCIIToUTF16("range underflow");
- if (name == WebKit::WebLocalizedString::ValidationRangeOverflow)
+ if (name == blink::WebLocalizedString::ValidationRangeOverflow)
return ASCIIToUTF16("range overflow");
return WebKitPlatformSupportImpl::queryLocalizedString(name, value);
}
-WebKit::WebString TestWebKitPlatformSupport::queryLocalizedString(
- WebKit::WebLocalizedString::Name name,
- const WebKit::WebString& value1,
- const WebKit::WebString& value2) {
- if (name == WebKit::WebLocalizedString::ValidationTooLong)
+blink::WebString TestWebKitPlatformSupport::queryLocalizedString(
+ blink::WebLocalizedString::Name name,
+ const blink::WebString& value1,
+ const blink::WebString& value2) {
+ if (name == blink::WebLocalizedString::ValidationTooLong)
return ASCIIToUTF16("too long");
- if (name == WebKit::WebLocalizedString::ValidationStepMismatch)
+ if (name == blink::WebLocalizedString::ValidationStepMismatch)
return ASCIIToUTF16("step mismatch");
return WebKitPlatformSupportImpl::queryLocalizedString(name, value1, value2);
}
-WebKit::WebString TestWebKitPlatformSupport::defaultLocale() {
+blink::WebString TestWebKitPlatformSupport::defaultLocale() {
return ASCIIToUTF16("en-US");
}
#if defined(OS_WIN) || defined(OS_MACOSX)
-void TestWebKitPlatformSupport::SetThemeEngine(WebKit::WebThemeEngine* engine) {
+void TestWebKitPlatformSupport::SetThemeEngine(blink::WebThemeEngine* engine) {
active_theme_engine_ = engine ?
engine : WebKitPlatformSupportChildImpl::themeEngine();
}
-WebKit::WebThemeEngine* TestWebKitPlatformSupport::themeEngine() {
+blink::WebThemeEngine* TestWebKitPlatformSupport::themeEngine() {
return active_theme_engine_;
}
#endif
-WebKit::WebCompositorSupport* TestWebKitPlatformSupport::compositorSupport() {
+blink::WebCompositorSupport* TestWebKitPlatformSupport::compositorSupport() {
return &compositor_support_;
}
@@ -243,39 +243,39 @@ TestWebKitPlatformSupport::CreateResourceLoader(
webkit_glue::WebSocketStreamHandleBridge*
TestWebKitPlatformSupport::CreateWebSocketStreamBridge(
- WebKit::WebSocketStreamHandle* handle,
+ blink::WebSocketStreamHandle* handle,
webkit_glue::WebSocketStreamHandleDelegate* delegate) {
NOTREACHED();
return NULL;
}
-WebKit::WebGestureCurve* TestWebKitPlatformSupport::createFlingAnimationCurve(
+blink::WebGestureCurve* TestWebKitPlatformSupport::createFlingAnimationCurve(
int device_source,
- const WebKit::WebFloatPoint& velocity,
- const WebKit::WebSize& cumulative_scroll) {
+ const blink::WebFloatPoint& velocity,
+ const blink::WebSize& cumulative_scroll) {
// Caller will retain and release.
return new WebGestureCurveMock(velocity, cumulative_scroll);
}
-WebKit::WebUnitTestSupport* TestWebKitPlatformSupport::unitTestSupport() {
+blink::WebUnitTestSupport* TestWebKitPlatformSupport::unitTestSupport() {
return this;
}
void TestWebKitPlatformSupport::registerMockedURL(
- const WebKit::WebURL& url,
- const WebKit::WebURLResponse& response,
- const WebKit::WebString& file_path) {
+ const blink::WebURL& url,
+ const blink::WebURLResponse& response,
+ const blink::WebString& file_path) {
url_loader_factory_->RegisterURL(url, response, file_path);
}
void TestWebKitPlatformSupport::registerMockedErrorURL(
- const WebKit::WebURL& url,
- const WebKit::WebURLResponse& response,
- const WebKit::WebURLError& error) {
+ const blink::WebURL& url,
+ const blink::WebURLResponse& response,
+ const blink::WebURLError& error) {
url_loader_factory_->RegisterErrorURL(url, response, error);
}
-void TestWebKitPlatformSupport::unregisterMockedURL(const WebKit::WebURL& url) {
+void TestWebKitPlatformSupport::unregisterMockedURL(const blink::WebURL& url) {
url_loader_factory_->UnregisterURL(url);
}
@@ -287,7 +287,7 @@ void TestWebKitPlatformSupport::serveAsynchronousMockedRequests() {
url_loader_factory_->ServeAsynchronousRequests();
}
-WebKit::WebString TestWebKitPlatformSupport::webKitRootDir() {
+blink::WebString TestWebKitPlatformSupport::webKitRootDir() {
base::FilePath path;
PathService::Get(base::DIR_SOURCE_ROOT, &path);
path = path.Append(FILE_PATH_LITERAL("third_party/WebKit"));
@@ -295,10 +295,10 @@ WebKit::WebString TestWebKitPlatformSupport::webKitRootDir() {
CHECK(!path.empty());
std::string path_ascii = path.MaybeAsASCII();
CHECK(!path_ascii.empty());
- return WebKit::WebString::fromUTF8(path_ascii.c_str());
+ return blink::WebString::fromUTF8(path_ascii.c_str());
}
-WebKit::WebLayerTreeView*
+blink::WebLayerTreeView*
TestWebKitPlatformSupport::createLayerTreeViewForTesting() {
scoped_ptr<WebLayerTreeViewImplForTesting> view(
new WebLayerTreeViewImplForTesting());
@@ -308,20 +308,20 @@ TestWebKitPlatformSupport::createLayerTreeViewForTesting() {
return view.release();
}
-WebKit::WebLayerTreeView*
+blink::WebLayerTreeView*
TestWebKitPlatformSupport::createLayerTreeViewForTesting(TestViewType type) {
DCHECK_EQ(TestViewTypeUnitTest, type);
return createLayerTreeViewForTesting();
}
-WebKit::WebData TestWebKitPlatformSupport::readFromFile(
- const WebKit::WebString& path) {
+blink::WebData TestWebKitPlatformSupport::readFromFile(
+ const blink::WebString& path) {
base::FilePath file_path = base::FilePath::FromUTF16Unsafe(path);
std::string buffer;
base::ReadFileToString(file_path, &buffer);
- return WebKit::WebData(buffer.data(), buffer.size());
+ return blink::WebData(buffer.data(), buffer.size());
}
} // namespace content
« no previous file with comments | « content/test/test_webkit_platform_support.h ('k') | content/test/web_gesture_curve_mock.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698