diff options
Diffstat (limited to 'content/test')
25 files changed, 292 insertions, 292 deletions
diff --git a/content/test/accessibility_browser_test_utils.cc b/content/test/accessibility_browser_test_utils.cc index 7c8ef56..525ed30 100644 --- a/content/test/accessibility_browser_test_utils.cc +++ b/content/test/accessibility_browser_test_utils.cc @@ -20,7 +20,7 @@ namespace content { AccessibilityNotificationWaiter::AccessibilityNotificationWaiter( Shell* shell, AccessibilityMode accessibility_mode, - WebKit::WebAXEvent event_type) + blink::WebAXEvent event_type) : shell_(shell), event_to_wait_for_(event_type), loop_runner_(new MessageLoopRunner()), @@ -47,7 +47,7 @@ AccessibilityNotificationWaiter::GetAccessibilityNodeDataTree() const { } void AccessibilityNotificationWaiter::OnAccessibilityEvent( - WebKit::WebAXEvent event_type) { + blink::WebAXEvent event_type) { if (!IsAboutBlank() && event_to_wait_for_ == event_type) loop_runner_->Quit(); } diff --git a/content/test/accessibility_browser_test_utils.h b/content/test/accessibility_browser_test_utils.h index 4802780..74f0834 100644 --- a/content/test/accessibility_browser_test_utils.h +++ b/content/test/accessibility_browser_test_utils.h @@ -25,7 +25,7 @@ class AccessibilityNotificationWaiter { AccessibilityNotificationWaiter( Shell* shell, AccessibilityMode accessibility_mode, - WebKit::WebAXEvent event); + blink::WebAXEvent event); ~AccessibilityNotificationWaiter(); // Blocks until the specific accessibility notification registered in @@ -39,7 +39,7 @@ class AccessibilityNotificationWaiter { private: // Callback from RenderViewHostImpl. - void OnAccessibilityEvent(WebKit::WebAXEvent event); + void OnAccessibilityEvent(blink::WebAXEvent event); // Helper function to determine if the accessibility tree in // GetAccessibilityNodeDataTree() is about the page with the url @@ -48,7 +48,7 @@ class AccessibilityNotificationWaiter { Shell* shell_; RenderViewHostImpl* view_host_; - WebKit::WebAXEvent event_to_wait_for_; + blink::WebAXEvent event_to_wait_for_; scoped_refptr<MessageLoopRunner> loop_runner_; base::WeakPtrFactory<AccessibilityNotificationWaiter> weak_factory_; diff --git a/content/test/image_decoder_test.cc b/content/test/image_decoder_test.cc index 8387d4a..463cd0d1 100644 --- a/content/test/image_decoder_test.cc +++ b/content/test/image_decoder_test.cc @@ -51,7 +51,7 @@ base::FilePath GetMD5SumPath(const base::FilePath& path) { } #if defined(CALCULATE_MD5_SUMS) -void SaveMD5Sum(const base::FilePath& path, const WebKit::WebImage& web_image) { +void SaveMD5Sum(const base::FilePath& path, const blink::WebImage& web_image) { // Calculate MD5 sum. base::MD5Digest digest; web_image.getSkBitmap().lockPixels(); @@ -69,7 +69,7 @@ void SaveMD5Sum(const base::FilePath& path, const WebKit::WebImage& web_image) { #endif #if !defined(CALCULATE_MD5_SUMS) -void VerifyImage(const WebKit::WebImageDecoder& decoder, +void VerifyImage(const blink::WebImageDecoder& decoder, const base::FilePath& path, const base::FilePath& md5_sum_path, size_t frame_index) { @@ -81,7 +81,7 @@ void VerifyImage(const WebKit::WebImageDecoder& decoder, // Calculate MD5 sum. base::MD5Digest actual_digest; - WebKit::WebImage web_image = decoder.getFrameAtIndex(frame_index); + blink::WebImage web_image = decoder.getFrameAtIndex(frame_index); web_image.getSkBitmap().lockPixels(); base::MD5Sum(web_image.getSkBitmap().getPixels(), web_image.getSkBitmap().width() * web_image.getSkBitmap().height() * @@ -179,14 +179,14 @@ void ImageDecoderTest::TestWebKitImageDecoder(const base::FilePath& image_path, std::vector<char> image_contents; ReadFileToVector(image_path, &image_contents); EXPECT_TRUE(image_contents.size()); - scoped_ptr<WebKit::WebImageDecoder> decoder(CreateWebKitImageDecoder()); + scoped_ptr<blink::WebImageDecoder> decoder(CreateWebKitImageDecoder()); EXPECT_FALSE(decoder->isFailed()); if (should_test_chunking) { // Test chunking file into half. const int partial_size = image_contents.size()/2; - WebKit::WebData partial_data( + blink::WebData partial_data( reinterpret_cast<const char*>(&(image_contents.at(0))), partial_size); // Make Sure the image decoder doesn't fail when we ask for the frame @@ -194,14 +194,14 @@ void ImageDecoderTest::TestWebKitImageDecoder(const base::FilePath& image_path, // NOTE: We can't check that frame 0 is non-NULL, because if this is an // ICO and we haven't yet supplied enough data to read the directory, // there is no framecount and thus no first frame. - decoder->setData(const_cast<WebKit::WebData&>(partial_data), false); + decoder->setData(const_cast<blink::WebData&>(partial_data), false); EXPECT_FALSE(decoder->isFailed()) << image_path.value(); } // Make sure passing the complete image results in successful decoding. - WebKit::WebData data(reinterpret_cast<const char*>(&(image_contents.at(0))), + blink::WebData data(reinterpret_cast<const char*>(&(image_contents.at(0))), image_contents.size()); - decoder->setData(const_cast<WebKit::WebData&>(data), true); + decoder->setData(const_cast<blink::WebData&>(data), true); if (should_test_failed_images) { if (ShouldImageFail(image_path)) { @@ -217,8 +217,8 @@ void ImageDecoderTest::TestWebKitImageDecoder(const base::FilePath& image_path, // Since WebImage does not expose get data by frame, get the size // through decoder and pass it to fromData so that the closest // image dats to the size is returned. - WebKit::WebSize size(decoder->getImage(desired_frame_index).size()); - const WebKit::WebImage& image = WebKit::WebImage::fromData(data, size); + blink::WebSize size(decoder->getImage(desired_frame_index).size()); + const blink::WebImage& image = blink::WebImage::fromData(data, size); SaveMD5Sum(md5_sum_path, image); #else VerifyImage(*decoder, image_path, md5_sum_path, desired_frame_index); diff --git a/content/test/image_decoder_test.h b/content/test/image_decoder_test.h index a7130ea..5983e7aed 100644 --- a/content/test/image_decoder_test.h +++ b/content/test/image_decoder_test.h @@ -14,7 +14,7 @@ #include "testing/gtest/include/gtest/gtest.h" -namespace WebKit { class WebImageDecoder; } +namespace blink { class WebImageDecoder; } // If CALCULATE_MD5_SUMS is not defined, then this test decodes a handful of // image files and compares their MD5 sums to the stored sums on disk. @@ -70,7 +70,7 @@ class ImageDecoderTest : public testing::Test { } // Creates WebKit API's decoder. - virtual WebKit::WebImageDecoder* CreateWebKitImageDecoder() const = 0; + virtual blink::WebImageDecoder* CreateWebKitImageDecoder() const = 0; // The format to be decoded, like "bmp" or "ico". std::string format_; diff --git a/content/test/layouttest_support.cc b/content/test/layouttest_support.cc index dccc77b..97eb7c4 100644 --- a/content/test/layouttest_support.cc +++ b/content/test/layouttest_support.cc @@ -26,11 +26,11 @@ #include "content/browser/renderer_host/popup_menu_helper_mac.h" #endif -using WebKit::WebDeviceMotionData; -using WebKit::WebDeviceOrientationData; -using WebKit::WebGamepads; -using WebKit::WebRect; -using WebKit::WebSize; +using blink::WebDeviceMotionData; +using blink::WebDeviceOrientationData; +using blink::WebGamepads; +using blink::WebRect; +using blink::WebSize; using WebTestRunner::WebFrameTestProxy; using WebTestRunner::WebTestProxy; using WebTestRunner::WebTestProxyBase; diff --git a/content/test/mock_webclipboard_impl.cc b/content/test/mock_webclipboard_impl.cc index 1cfac9b..a0b44bd 100644 --- a/content/test/mock_webclipboard_impl.cc +++ b/content/test/mock_webclipboard_impl.cc @@ -20,10 +20,10 @@ #include "ui/gfx/size.h" #include "webkit/glue/webkit_glue.h" -using WebKit::WebDragData; -using WebKit::WebString; -using WebKit::WebURL; -using WebKit::WebVector; +using blink::WebDragData; +using blink::WebString; +using blink::WebURL; +using blink::WebVector; namespace content { @@ -86,15 +86,15 @@ WebVector<WebString> MockWebClipboardImpl::readAvailableTypes( return results; } -WebKit::WebString MockWebClipboardImpl::readPlainText( - WebKit::WebClipboard::Buffer buffer) { +blink::WebString MockWebClipboardImpl::readPlainText( + blink::WebClipboard::Buffer buffer) { return m_plainText; } // TODO(wtc): set output argument *url. -WebKit::WebString MockWebClipboardImpl::readHTML( - WebKit::WebClipboard::Buffer buffer, - WebKit::WebURL* url, +blink::WebString MockWebClipboardImpl::readHTML( + blink::WebClipboard::Buffer buffer, + blink::WebURL* url, unsigned* fragmentStart, unsigned* fragmentEnd) { *fragmentStart = 0; @@ -102,8 +102,8 @@ WebKit::WebString MockWebClipboardImpl::readHTML( return m_htmlText; } -WebKit::WebData MockWebClipboardImpl::readImage( - WebKit::WebClipboard::Buffer buffer) { +blink::WebData MockWebClipboardImpl::readImage( + blink::WebClipboard::Buffer buffer) { std::string data; std::vector<unsigned char> encoded_image; // TODO(dcheng): Verify that we can assume the image is ARGB8888. Note that @@ -126,19 +126,19 @@ WebKit::WebData MockWebClipboardImpl::readImage( return data; } -WebKit::WebString MockWebClipboardImpl::readCustomData( - WebKit::WebClipboard::Buffer buffer, - const WebKit::WebString& type) { +blink::WebString MockWebClipboardImpl::readCustomData( + blink::WebClipboard::Buffer buffer, + const blink::WebString& type) { std::map<base::string16, base::string16>::const_iterator it = m_customData.find(type); if (it != m_customData.end()) return it->second; - return WebKit::WebString(); + return blink::WebString(); } -void MockWebClipboardImpl::writeHTML(const WebKit::WebString& htmlText, - const WebKit::WebURL& url, - const WebKit::WebString& plainText, +void MockWebClipboardImpl::writeHTML(const blink::WebString& htmlText, + const blink::WebURL& url, + const blink::WebString& plainText, bool writeSmartPaste) { clear(); @@ -147,23 +147,23 @@ void MockWebClipboardImpl::writeHTML(const WebKit::WebString& htmlText, m_writeSmartPaste = writeSmartPaste; } -void MockWebClipboardImpl::writePlainText(const WebKit::WebString& plain_text) { +void MockWebClipboardImpl::writePlainText(const blink::WebString& plain_text) { clear(); m_plainText = plain_text; } -void MockWebClipboardImpl::writeURL(const WebKit::WebURL& url, - const WebKit::WebString& title) { +void MockWebClipboardImpl::writeURL(const blink::WebURL& url, + const blink::WebString& title) { clear(); m_htmlText = WebString::fromUTF8(URLToMarkup(url, title)); m_plainText = url.spec().utf16(); } -void MockWebClipboardImpl::writeImage(const WebKit::WebImage& image, - const WebKit::WebURL& url, - const WebKit::WebString& title) { +void MockWebClipboardImpl::writeImage(const blink::WebImage& image, + const blink::WebURL& url, + const blink::WebString& title) { if (!image.isNull()) { clear(); diff --git a/content/test/mock_webclipboard_impl.h b/content/test/mock_webclipboard_impl.h index 9b2fcf4..7c85ec4 100644 --- a/content/test/mock_webclipboard_impl.h +++ b/content/test/mock_webclipboard_impl.h @@ -19,42 +19,42 @@ namespace content { -class MockWebClipboardImpl : public WebKit::WebClipboard { +class MockWebClipboardImpl : public blink::WebClipboard { public: MockWebClipboardImpl(); virtual ~MockWebClipboardImpl(); - virtual bool isFormatAvailable(WebKit::WebClipboard::Format format, - WebKit::WebClipboard::Buffer buffer); - virtual WebKit::WebVector<WebKit::WebString> readAvailableTypes( - WebKit::WebClipboard::Buffer buffer, bool* containsFilenames); + virtual bool isFormatAvailable(blink::WebClipboard::Format format, + blink::WebClipboard::Buffer buffer); + virtual blink::WebVector<blink::WebString> readAvailableTypes( + blink::WebClipboard::Buffer buffer, bool* containsFilenames); - virtual WebKit::WebString readPlainText(WebKit::WebClipboard::Buffer buffer); - virtual WebKit::WebString readHTML(WebKit::WebClipboard::Buffer buffer, - WebKit::WebURL* url, + virtual blink::WebString readPlainText(blink::WebClipboard::Buffer buffer); + virtual blink::WebString readHTML(blink::WebClipboard::Buffer buffer, + blink::WebURL* url, unsigned* fragmentStart, unsigned* fragmentEnd); - virtual WebKit::WebData readImage(WebKit::WebClipboard::Buffer buffer); - virtual WebKit::WebString readCustomData(WebKit::WebClipboard::Buffer buffer, - const WebKit::WebString& type); + virtual blink::WebData readImage(blink::WebClipboard::Buffer buffer); + virtual blink::WebString readCustomData(blink::WebClipboard::Buffer buffer, + const blink::WebString& type); - virtual void writePlainText(const WebKit::WebString& plain_text); + virtual void writePlainText(const blink::WebString& plain_text); virtual void writeHTML( - const WebKit::WebString& htmlText, const WebKit::WebURL& url, - const WebKit::WebString& plainText, bool writeSmartPaste); + const blink::WebString& htmlText, const blink::WebURL& url, + const blink::WebString& plainText, bool writeSmartPaste); virtual void writeURL( - const WebKit::WebURL& url, const WebKit::WebString& title); + const blink::WebURL& url, const blink::WebString& title); virtual void writeImage( - const WebKit::WebImage& image, const WebKit::WebURL& url, - const WebKit::WebString& title); - virtual void writeDataObject(const WebKit::WebDragData& data); + const blink::WebImage& image, const blink::WebURL& url, + const blink::WebString& title); + virtual void writeDataObject(const blink::WebDragData& data); private: void clear(); - WebKit::WebString m_plainText; - WebKit::WebString m_htmlText; - WebKit::WebImage m_image; + blink::WebString m_plainText; + blink::WebString m_htmlText; + blink::WebImage m_image; std::map<base::string16, base::string16> m_customData; bool m_writeSmartPaste; }; diff --git a/content/test/mock_webframeclient.h b/content/test/mock_webframeclient.h index 5683fd6..bba8aa5 100644 --- a/content/test/mock_webframeclient.h +++ b/content/test/mock_webframeclient.h @@ -9,7 +9,7 @@ namespace content { -class MockWebFrameClient : public WebKit::WebFrameClient {}; +class MockWebFrameClient : public blink::WebFrameClient {}; } // namespace content diff --git a/content/test/mock_weburlloader.h b/content/test/mock_weburlloader.h index 15698c8..db26111 100644 --- a/content/test/mock_weburlloader.h +++ b/content/test/mock_weburlloader.h @@ -10,17 +10,17 @@ namespace content { -class MockWebURLLoader : public WebKit::WebURLLoader { +class MockWebURLLoader : public blink::WebURLLoader { public: MockWebURLLoader(); virtual ~MockWebURLLoader(); - MOCK_METHOD4(loadSynchronously, void(const WebKit::WebURLRequest& request, - WebKit::WebURLResponse& response, - WebKit::WebURLError& error, - WebKit::WebData& data)); - MOCK_METHOD2(loadAsynchronously, void(const WebKit::WebURLRequest& request, - WebKit::WebURLLoaderClient* client)); + MOCK_METHOD4(loadSynchronously, void(const blink::WebURLRequest& request, + blink::WebURLResponse& response, + blink::WebURLError& error, + blink::WebData& data)); + MOCK_METHOD2(loadAsynchronously, void(const blink::WebURLRequest& request, + blink::WebURLLoaderClient* client)); MOCK_METHOD0(cancel, void()); MOCK_METHOD1(setDefersLoading, void(bool value)); diff --git a/content/test/test_media_stream_client.cc b/content/test/test_media_stream_client.cc index 5e8d946..0b7b2e3 100644 --- a/content/test/test_media_stream_client.cc +++ b/content/test/test_media_stream_client.cc @@ -11,7 +11,7 @@ #include "third_party/WebKit/public/web/WebMediaStreamRegistry.h" #include "url/gurl.h" -using namespace WebKit; +using namespace blink; namespace { diff --git a/content/test/test_web_contents.cc b/content/test/test_web_contents.cc index 15d8a6ac..178de17 100644 --- a/content/test/test_web_contents.cc +++ b/content/test/test_web_contents.cc @@ -226,7 +226,7 @@ void TestWebContents::CreateNewWindow( } void TestWebContents::CreateNewWidget(int route_id, - WebKit::WebPopupType popup_type) { + blink::WebPopupType popup_type) { } void TestWebContents::CreateNewFullscreenWidget(int route_id) { diff --git a/content/test/test_web_contents.h b/content/test/test_web_contents.h index 55024b8..e64399b 100644 --- a/content/test/test_web_contents.h +++ b/content/test/test_web_contents.h @@ -111,7 +111,7 @@ class TestWebContents : public WebContentsImpl, public WebContentsTester { const ViewHostMsg_CreateWindow_Params& params, SessionStorageNamespace* session_storage_namespace) OVERRIDE; virtual void CreateNewWidget(int route_id, - WebKit::WebPopupType popup_type) OVERRIDE; + blink::WebPopupType popup_type) OVERRIDE; virtual void CreateNewFullscreenWidget(int route_id) OVERRIDE; virtual void ShowCreatedWindow(int route_id, WindowOpenDisposition disposition, diff --git a/content/test/test_web_contents_view.cc b/content/test/test_web_contents_view.cc index b732a01..9bed145 100644 --- a/content/test/test_web_contents_view.cc +++ b/content/test/test_web_contents_view.cc @@ -23,13 +23,13 @@ void TestWebContentsView::ShowPopupMenu(const gfx::Rect& bounds, void TestWebContentsView::StartDragging( const DropData& drop_data, - WebKit::WebDragOperationsMask allowed_ops, + blink::WebDragOperationsMask allowed_ops, const gfx::ImageSkia& image, const gfx::Vector2d& image_offset, const DragEventSourceInfo& event_info) { } -void TestWebContentsView::UpdateDragCursor(WebKit::WebDragOperation operation) { +void TestWebContentsView::UpdateDragCursor(blink::WebDragOperation operation) { } void TestWebContentsView::GotFocus() { diff --git a/content/test/test_web_contents_view.h b/content/test/test_web_contents_view.h index a087f78..707b632 100644 --- a/content/test/test_web_contents_view.h +++ b/content/test/test_web_contents_view.h @@ -26,11 +26,11 @@ class TestWebContentsView : public WebContentsViewPort, bool right_aligned, bool allow_multiple_selection) OVERRIDE; virtual void StartDragging(const DropData& drop_data, - WebKit::WebDragOperationsMask allowed_ops, + blink::WebDragOperationsMask allowed_ops, const gfx::ImageSkia& image, const gfx::Vector2d& image_offset, const DragEventSourceInfo& event_info) OVERRIDE; - virtual void UpdateDragCursor(WebKit::WebDragOperation operation) OVERRIDE; + virtual void UpdateDragCursor(blink::WebDragOperation operation) OVERRIDE; virtual void GotFocus() OVERRIDE; virtual void TakeFocus(bool reverse) OVERRIDE; diff --git a/content/test/test_webkit_platform_support.cc b/content/test/test_webkit_platform_support.cc index 4c9bf77..bc93658 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 diff --git a/content/test/test_webkit_platform_support.h b/content/test/test_webkit_platform_support.h index 6c01f84..71b0300 100644 --- a/content/test/test_webkit_platform_support.h +++ b/content/test/test_webkit_platform_support.h @@ -15,7 +15,7 @@ #include "webkit/glue/webfileutilities_impl.h" #include "webkit/renderer/compositor_bindings/web_compositor_support_impl.h" -namespace WebKit { +namespace blink { class WebLayerTreeView; } @@ -23,36 +23,36 @@ namespace content { // An implementation of WebKitPlatformSupport for tests. class TestWebKitPlatformSupport - : public WebKit::WebUnitTestSupport, + : public blink::WebUnitTestSupport, public webkit_glue::WebKitPlatformSupportChildImpl { public: TestWebKitPlatformSupport(); virtual ~TestWebKitPlatformSupport(); - virtual WebKit::WebMimeRegistry* mimeRegistry(); - virtual WebKit::WebClipboard* clipboard(); - virtual WebKit::WebFileUtilities* fileUtilities(); - virtual WebKit::WebIDBFactory* idbFactory(); - - virtual WebKit::WebURLLoader* createURLLoader(); - virtual WebKit::WebData loadResource(const char* name); - virtual WebKit::WebString queryLocalizedString( - WebKit::WebLocalizedString::Name name); - virtual WebKit::WebString queryLocalizedString( - WebKit::WebLocalizedString::Name name, - const WebKit::WebString& value); - virtual WebKit::WebString queryLocalizedString( - WebKit::WebLocalizedString::Name name, - const WebKit::WebString& value1, - const WebKit::WebString& value2); - virtual WebKit::WebString defaultLocale(); + virtual blink::WebMimeRegistry* mimeRegistry(); + virtual blink::WebClipboard* clipboard(); + virtual blink::WebFileUtilities* fileUtilities(); + virtual blink::WebIDBFactory* idbFactory(); + + virtual blink::WebURLLoader* createURLLoader(); + virtual blink::WebData loadResource(const char* name); + virtual blink::WebString queryLocalizedString( + blink::WebLocalizedString::Name name); + virtual blink::WebString queryLocalizedString( + blink::WebLocalizedString::Name name, + const blink::WebString& value); + virtual blink::WebString queryLocalizedString( + blink::WebLocalizedString::Name name, + const blink::WebString& value1, + const blink::WebString& value2); + virtual blink::WebString defaultLocale(); #if defined(OS_WIN) || defined(OS_MACOSX) - void SetThemeEngine(WebKit::WebThemeEngine* engine); - virtual WebKit::WebThemeEngine* themeEngine(); + void SetThemeEngine(blink::WebThemeEngine* engine); + virtual blink::WebThemeEngine* themeEngine(); #endif - virtual WebKit::WebCompositorSupport* compositorSupport(); + virtual blink::WebCompositorSupport* compositorSupport(); WebURLLoaderMockFactory* url_loader_factory() { return url_loader_factory_.get(); @@ -70,31 +70,31 @@ class TestWebKitPlatformSupport const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info) OVERRIDE; virtual webkit_glue::WebSocketStreamHandleBridge* CreateWebSocketStreamBridge( - WebKit::WebSocketStreamHandle* handle, + blink::WebSocketStreamHandle* handle, webkit_glue::WebSocketStreamHandleDelegate* delegate) OVERRIDE; - virtual WebKit::WebGestureCurve* createFlingAnimationCurve( + virtual blink::WebGestureCurve* createFlingAnimationCurve( int device_source, - const WebKit::WebFloatPoint& velocity, - const WebKit::WebSize& cumulative_scroll); + const blink::WebFloatPoint& velocity, + const blink::WebSize& cumulative_scroll); - virtual WebKit::WebUnitTestSupport* unitTestSupport(); + virtual blink::WebUnitTestSupport* unitTestSupport(); // WebUnitTestSupport implementation - virtual void registerMockedURL(const WebKit::WebURL& url, - const WebKit::WebURLResponse& response, - const WebKit::WebString& filePath); - virtual void registerMockedErrorURL(const WebKit::WebURL& url, - const WebKit::WebURLResponse& response, - const WebKit::WebURLError& error); - virtual void unregisterMockedURL(const WebKit::WebURL& url); + virtual void registerMockedURL(const blink::WebURL& url, + const blink::WebURLResponse& response, + const blink::WebString& filePath); + virtual void registerMockedErrorURL(const blink::WebURL& url, + const blink::WebURLResponse& response, + const blink::WebURLError& error); + virtual void unregisterMockedURL(const blink::WebURL& url); virtual void unregisterAllMockedURLs(); virtual void serveAsynchronousMockedRequests(); - virtual WebKit::WebString webKitRootDir(); - virtual WebKit::WebLayerTreeView* createLayerTreeViewForTesting(); - virtual WebKit::WebLayerTreeView* createLayerTreeViewForTesting( + virtual blink::WebString webKitRootDir(); + virtual blink::WebLayerTreeView* createLayerTreeViewForTesting(); + virtual blink::WebLayerTreeView* createLayerTreeViewForTesting( TestViewType type); - virtual WebKit::WebData readFromFile(const WebKit::WebString& path); + virtual blink::WebData readFromFile(const blink::WebString& path); private: webkit_glue::SimpleWebMimeRegistryImpl mime_registry_; @@ -105,7 +105,7 @@ class TestWebKitPlatformSupport webkit::WebCompositorSupportImpl compositor_support_; #if defined(OS_WIN) || defined(OS_MACOSX) - WebKit::WebThemeEngine* active_theme_engine_; + blink::WebThemeEngine* active_theme_engine_; #endif DISALLOW_COPY_AND_ASSIGN(TestWebKitPlatformSupport); }; diff --git a/content/test/web_gesture_curve_mock.cc b/content/test/web_gesture_curve_mock.cc index 0fd96df..f60733c 100644 --- a/content/test/web_gesture_curve_mock.cc +++ b/content/test/web_gesture_curve_mock.cc @@ -8,8 +8,8 @@ #include "third_party/WebKit/public/platform/WebFloatSize.h" #include "third_party/WebKit/public/platform/WebGestureCurveTarget.h" -WebGestureCurveMock::WebGestureCurveMock(const WebKit::WebFloatPoint& velocity, - const WebKit::WebSize& cumulative_scroll) +WebGestureCurveMock::WebGestureCurveMock(const blink::WebFloatPoint& velocity, + const blink::WebSize& cumulative_scroll) : velocity_(velocity), cumulative_scroll_(cumulative_scroll) { } @@ -18,12 +18,12 @@ WebGestureCurveMock::~WebGestureCurveMock() { } bool WebGestureCurveMock::apply(double time, - WebKit::WebGestureCurveTarget* target) { - WebKit::WebSize displacement(velocity_.x * time, velocity_.y * time); - WebKit::WebFloatSize increment(displacement.width - cumulative_scroll_.width, + blink::WebGestureCurveTarget* target) { + blink::WebSize displacement(velocity_.x * time, velocity_.y * time); + blink::WebFloatSize increment(displacement.width - cumulative_scroll_.width, displacement.height - cumulative_scroll_.height); cumulative_scroll_ = displacement; - target->notifyCurrentFlingVelocity(WebKit::WebFloatSize(velocity_.x, + target->notifyCurrentFlingVelocity(blink::WebFloatSize(velocity_.x, velocity_.y)); // scrollBy() could delete this curve if the animation is over, so don't // touch any member variables after making that call. diff --git a/content/test/web_gesture_curve_mock.h b/content/test/web_gesture_curve_mock.h index d58137f..e103c17 100644 --- a/content/test/web_gesture_curve_mock.h +++ b/content/test/web_gesture_curve_mock.h @@ -12,19 +12,19 @@ // A simple class for mocking a WebGestureCurve. The curve flings at velocity // indefinitely. -class WebGestureCurveMock : public WebKit::WebGestureCurve { +class WebGestureCurveMock : public blink::WebGestureCurve { public: - WebGestureCurveMock(const WebKit::WebFloatPoint& velocity, - const WebKit::WebSize& cumulative_scroll); + WebGestureCurveMock(const blink::WebFloatPoint& velocity, + const blink::WebSize& cumulative_scroll); virtual ~WebGestureCurveMock(); // Returns false if curve has finished and can no longer be applied. virtual bool apply(double time, - WebKit::WebGestureCurveTarget* target) OVERRIDE; + blink::WebGestureCurveTarget* target) OVERRIDE; private: - WebKit::WebFloatPoint velocity_; - WebKit::WebSize cumulative_scroll_; + blink::WebFloatPoint velocity_; + blink::WebSize cumulative_scroll_; DISALLOW_COPY_AND_ASSIGN(WebGestureCurveMock); }; diff --git a/content/test/web_layer_tree_view_impl_for_testing.cc b/content/test/web_layer_tree_view_impl_for_testing.cc index 7858fd8..3bd6532 100644 --- a/content/test/web_layer_tree_view_impl_for_testing.cc +++ b/content/test/web_layer_tree_view_impl_for_testing.cc @@ -24,11 +24,11 @@ #include "webkit/common/gpu/test_context_provider_factory.h" #include "webkit/renderer/compositor_bindings/web_layer_impl.h" -using WebKit::WebColor; -using WebKit::WebGraphicsContext3D; -using WebKit::WebRect; -using WebKit::WebRenderingStats; -using WebKit::WebSize; +using blink::WebColor; +using blink::WebGraphicsContext3D; +using blink::WebRect; +using blink::WebRenderingStats; +using blink::WebSize; namespace webkit { @@ -57,7 +57,7 @@ void WebLayerTreeViewImplForTesting::setSurfaceReady() { } void WebLayerTreeViewImplForTesting::setRootLayer( - const WebKit::WebLayer& root) { + const blink::WebLayer& root) { layer_tree_host_->SetRootLayer( static_cast<const WebLayerImpl*>(&root)->layer()); } @@ -111,7 +111,7 @@ void WebLayerTreeViewImplForTesting::setPageScaleFactorAndLimits( } void WebLayerTreeViewImplForTesting::startPageScaleAnimation( - const WebKit::WebPoint& scroll, + const blink::WebPoint& scroll, bool use_anchor, float new_page_scale, double duration_sec) {} diff --git a/content/test/web_layer_tree_view_impl_for_testing.h b/content/test/web_layer_tree_view_impl_for_testing.h index 6f0d4aa..311775605 100644 --- a/content/test/web_layer_tree_view_impl_for_testing.h +++ b/content/test/web_layer_tree_view_impl_for_testing.h @@ -14,12 +14,12 @@ namespace cc { class LayerTreeHost; } -namespace WebKit { class WebLayer; } +namespace blink { class WebLayer; } namespace webkit { class WebLayerTreeViewImplForTesting - : public WebKit::WebLayerTreeView, + : public blink::WebLayerTreeView, public cc::LayerTreeHostClient, public cc::LayerTreeHostSingleThreadClient { public: @@ -28,23 +28,23 @@ class WebLayerTreeViewImplForTesting bool Initialize(); - // WebKit::WebLayerTreeView implementation. + // blink::WebLayerTreeView implementation. virtual void setSurfaceReady(); - virtual void setRootLayer(const WebKit::WebLayer& layer); + virtual void setRootLayer(const blink::WebLayer& layer); virtual void clearRootLayer(); - virtual void setViewportSize(const WebKit::WebSize& unused_deprecated, - const WebKit::WebSize& device_viewport_size); - virtual WebKit::WebSize layoutViewportSize() const; - virtual WebKit::WebSize deviceViewportSize() const; + virtual void setViewportSize(const blink::WebSize& unused_deprecated, + const blink::WebSize& device_viewport_size); + virtual blink::WebSize layoutViewportSize() const; + virtual blink::WebSize deviceViewportSize() const; virtual void setDeviceScaleFactor(float scale_factor); virtual float deviceScaleFactor() const; - virtual void setBackgroundColor(WebKit::WebColor); + virtual void setBackgroundColor(blink::WebColor); virtual void setHasTransparentBackground(bool transparent); virtual void setVisible(bool visible); virtual void setPageScaleFactorAndLimits(float page_scale_factor, float minimum, float maximum); - virtual void startPageScaleAnimation(const WebKit::WebPoint& destination, + virtual void startPageScaleAnimation(const blink::WebPoint& destination, bool use_anchor, float new_page_scale, double duration_sec); @@ -53,11 +53,11 @@ class WebLayerTreeViewImplForTesting virtual bool commitRequested() const; virtual void composite(); virtual void didStopFlinging(); - virtual bool compositeAndReadback(void* pixels, const WebKit::WebRect& rect); + virtual bool compositeAndReadback(void* pixels, const blink::WebRect& rect); virtual void finishAllRendering(); virtual void setDeferCommits(bool defer_commits); virtual void renderingStats( - WebKit::WebRenderingStats& stats) const; // NOLINT(runtime/references) + blink::WebRenderingStats& stats) const; // NOLINT(runtime/references) // cc::LayerTreeHostClient implementation. virtual void WillBeginMainFrame() OVERRIDE {} diff --git a/content/test/webkit_support.cc b/content/test/webkit_support.cc index 01f80de..bb234353 100644 --- a/content/test/webkit_support.cc +++ b/content/test/webkit_support.cc @@ -57,9 +57,9 @@ TestEnvironment* test_environment; } // namespace void SetUpTestEnvironmentForUnitTests() { - WebKit::WebRuntimeFeatures::enableStableFeatures(true); - WebKit::WebRuntimeFeatures::enableExperimentalFeatures(true); - WebKit::WebRuntimeFeatures::enableTestOnlyFeatures(true); + blink::WebRuntimeFeatures::enableStableFeatures(true); + blink::WebRuntimeFeatures::enableExperimentalFeatures(true); + blink::WebRuntimeFeatures::enableTestOnlyFeatures(true); #if defined(OS_ANDROID) JNIEnv* env = base::android::AttachCurrentThread(); @@ -85,7 +85,7 @@ void TearDownTestEnvironment() { base::RunLoop().RunUntilIdle(); if (RunningOnValgrind()) - WebKit::WebCache::clear(); + blink::WebCache::clear(); delete test_environment; test_environment = NULL; } diff --git a/content/test/weburl_loader_mock.cc b/content/test/weburl_loader_mock.cc index 4eb37be53..5503053 100644 --- a/content/test/weburl_loader_mock.cc +++ b/content/test/weburl_loader_mock.cc @@ -11,7 +11,7 @@ #include "third_party/WebKit/public/platform/WebURLLoaderClient.h" WebURLLoaderMock::WebURLLoaderMock(WebURLLoaderMockFactory* factory, - WebKit::WebURLLoader* default_loader) + blink::WebURLLoader* default_loader) : factory_(factory), client_(NULL), default_loader_(default_loader), @@ -23,9 +23,9 @@ WebURLLoaderMock::~WebURLLoaderMock() { } void WebURLLoaderMock::ServeAsynchronousRequest( - const WebKit::WebURLResponse& response, - const WebKit::WebData& data, - const WebKit::WebURLError& error) { + const blink::WebURLResponse& response, + const blink::WebData& data, + const blink::WebURLError& error) { DCHECK(!using_default_loader_); if (!client_) return; @@ -40,9 +40,9 @@ void WebURLLoaderMock::ServeAsynchronousRequest( client_->didFinishLoading(this, 0); } -WebKit::WebURLRequest WebURLLoaderMock::ServeRedirect( - const WebKit::WebURLResponse& redirectResponse) { - WebKit::WebURLRequest newRequest; +blink::WebURLRequest WebURLLoaderMock::ServeRedirect( + const blink::WebURLResponse& redirectResponse) { + blink::WebURLRequest newRequest; newRequest.initialize(); GURL redirectURL(redirectResponse.httpHeaderField("Location")); newRequest.setURL(redirectURL); @@ -50,10 +50,10 @@ WebKit::WebURLRequest WebURLLoaderMock::ServeRedirect( return newRequest; } -void WebURLLoaderMock::loadSynchronously(const WebKit::WebURLRequest& request, - WebKit::WebURLResponse& response, - WebKit::WebURLError& error, - WebKit::WebData& data) { +void WebURLLoaderMock::loadSynchronously(const blink::WebURLRequest& request, + blink::WebURLResponse& response, + blink::WebURLError& error, + blink::WebData& data) { if (factory_->IsMockedURL(request.url())) { factory_->LoadSynchronously(request, &response, &error, &data); return; @@ -65,8 +65,8 @@ void WebURLLoaderMock::loadSynchronously(const WebKit::WebURLRequest& request, default_loader_->loadSynchronously(request, response, error, data); } -void WebURLLoaderMock::loadAsynchronously(const WebKit::WebURLRequest& request, - WebKit::WebURLLoaderClient* client) { +void WebURLLoaderMock::loadAsynchronously(const blink::WebURLRequest& request, + blink::WebURLLoaderClient* client) { if (factory_->IsMockedURL(request.url())) { client_ = client; factory_->LoadAsynchronouly(request, this); diff --git a/content/test/weburl_loader_mock.h b/content/test/weburl_loader_mock.h index 6a77fd9..ba2c078 100644 --- a/content/test/weburl_loader_mock.h +++ b/content/test/weburl_loader_mock.h @@ -9,7 +9,7 @@ #include "base/memory/scoped_ptr.h" #include "third_party/WebKit/public/platform/WebURLLoader.h" -namespace WebKit { +namespace blink { class WebData; struct WebURLError; class WebURLLoaderClient; @@ -23,29 +23,29 @@ class WebURLLoaderMockFactory; // If the WebURLLoaderMockFactory it is associated with has been configured to // mock the request it gets, it serves the mocked resource. Otherwise it just // forwards it to the default loader. -class WebURLLoaderMock : public WebKit::WebURLLoader { +class WebURLLoaderMock : public blink::WebURLLoader { public: // This object becomes the owner of |default_loader|. WebURLLoaderMock(WebURLLoaderMockFactory* factory, - WebKit::WebURLLoader* default_loader); + blink::WebURLLoader* default_loader); virtual ~WebURLLoaderMock(); // Simulates the asynchronous request being served. - void ServeAsynchronousRequest(const WebKit::WebURLResponse& response, - const WebKit::WebData& data, - const WebKit::WebURLError& error); + void ServeAsynchronousRequest(const blink::WebURLResponse& response, + const blink::WebData& data, + const blink::WebURLError& error); // Simulates the redirect being served. - WebKit::WebURLRequest ServeRedirect( - const WebKit::WebURLResponse& redirectResponse); + blink::WebURLRequest ServeRedirect( + const blink::WebURLResponse& redirectResponse); // WebURLLoader methods: - virtual void loadSynchronously(const WebKit::WebURLRequest& request, - WebKit::WebURLResponse& response, - WebKit::WebURLError& error, - WebKit::WebData& data); - virtual void loadAsynchronously(const WebKit::WebURLRequest& request, - WebKit::WebURLLoaderClient* client); + virtual void loadSynchronously(const blink::WebURLRequest& request, + blink::WebURLResponse& response, + blink::WebURLError& error, + blink::WebData& data); + virtual void loadAsynchronously(const blink::WebURLRequest& request, + blink::WebURLLoaderClient* client); virtual void cancel(); virtual void setDefersLoading(bool defer); @@ -53,8 +53,8 @@ class WebURLLoaderMock : public WebKit::WebURLLoader { private: WebURLLoaderMockFactory* factory_; - WebKit::WebURLLoaderClient* client_; - scoped_ptr<WebKit::WebURLLoader> default_loader_; + blink::WebURLLoaderClient* client_; + scoped_ptr<blink::WebURLLoader> default_loader_; bool using_default_loader_; bool is_deferred_; diff --git a/content/test/weburl_loader_mock_factory.cc b/content/test/weburl_loader_mock_factory.cc index 0b386e1..2c91e6f 100644 --- a/content/test/weburl_loader_mock_factory.cc +++ b/content/test/weburl_loader_mock_factory.cc @@ -15,14 +15,14 @@ #include "third_party/WebKit/public/platform/WebURLResponse.h" #include "third_party/WebKit/public/web/WebCache.h" -using WebKit::WebCache; -using WebKit::WebData; -using WebKit::WebString; -using WebKit::WebURL; -using WebKit::WebURLError; -using WebKit::WebURLLoader; -using WebKit::WebURLRequest; -using WebKit::WebURLResponse; +using blink::WebCache; +using blink::WebData; +using blink::WebString; +using blink::WebURL; +using blink::WebURLError; +using blink::WebURLLoader; +using blink::WebURLRequest; +using blink::WebURLResponse; WebURLLoaderMockFactory::WebURLLoaderMockFactory() {} @@ -60,7 +60,7 @@ void WebURLLoaderMockFactory::RegisterErrorURL(const WebURL& url, url_to_error_info_[url] = error; } -void WebURLLoaderMockFactory::UnregisterURL(const WebKit::WebURL& url) { +void WebURLLoaderMockFactory::UnregisterURL(const blink::WebURL& url) { URLToResponseMap::iterator iter = url_to_reponse_info_.find(url); DCHECK(iter != url_to_reponse_info_.end()); url_to_reponse_info_.erase(iter); @@ -107,12 +107,12 @@ void WebURLLoaderMockFactory::ServeAsynchronousRequests() { base::RunLoop().RunUntilIdle(); } -WebKit::WebURLRequest +blink::WebURLRequest WebURLLoaderMockFactory::GetLastHandledAsynchronousRequest() { return last_handled_asynchronous_request_; } -bool WebURLLoaderMockFactory::IsMockedURL(const WebKit::WebURL& url) { +bool WebURLLoaderMockFactory::IsMockedURL(const blink::WebURL& url) { return url_to_reponse_info_.find(url) != url_to_reponse_info_.end(); } diff --git a/content/test/weburl_loader_mock_factory.h b/content/test/weburl_loader_mock_factory.h index 50d126d..a51987bc 100644 --- a/content/test/weburl_loader_mock_factory.h +++ b/content/test/weburl_loader_mock_factory.h @@ -13,7 +13,7 @@ #include "third_party/WebKit/public/platform/WebURLRequest.h" #include "third_party/WebKit/public/platform/WebURLResponse.h" -namespace WebKit { +namespace blink { class WebData; class WebURLLoader; } @@ -34,22 +34,22 @@ class WebURLLoaderMockFactory { // Called by TestWebKitPlatformSupport to create a WebURLLoader. // Non-mocked request are forwarded to |default_loader| which should not be // NULL. - virtual WebKit::WebURLLoader* CreateURLLoader( - WebKit::WebURLLoader* default_loader); + virtual blink::WebURLLoader* CreateURLLoader( + blink::WebURLLoader* default_loader); // Registers a response and the contents to be served when the specified URL // is loaded. - void RegisterURL(const WebKit::WebURL& url, - const WebKit::WebURLResponse& response, - const WebKit::WebString& filePath); + void RegisterURL(const blink::WebURL& url, + const blink::WebURLResponse& response, + const blink::WebString& filePath); // Registers an error to be served when the specified URL is requested. - void RegisterErrorURL(const WebKit::WebURL& url, - const WebKit::WebURLResponse& response, - const WebKit::WebURLError& error); + void RegisterErrorURL(const blink::WebURL& url, + const blink::WebURLResponse& response, + const blink::WebURLError& error); // Unregisters |url| so it will no longer be mocked. - void UnregisterURL(const WebKit::WebURL& url); + void UnregisterURL(const blink::WebURL& url); // Unregister all URLs so no URL will be mocked anymore. void UnregisterAllURLs(); @@ -58,17 +58,17 @@ class WebURLLoaderMockFactory { void ServeAsynchronousRequests(); // Returns the last request handled by |ServeAsynchronousRequests()|. - WebKit::WebURLRequest GetLastHandledAsynchronousRequest(); + blink::WebURLRequest GetLastHandledAsynchronousRequest(); // Returns true if |url| was registered for being mocked. - bool IsMockedURL(const WebKit::WebURL& url); + bool IsMockedURL(const blink::WebURL& url); // Called by the loader to load a resource. - void LoadSynchronously(const WebKit::WebURLRequest& request, - WebKit::WebURLResponse* response, - WebKit::WebURLError* error, - WebKit::WebData* data); - void LoadAsynchronouly(const WebKit::WebURLRequest& request, + void LoadSynchronously(const blink::WebURLRequest& request, + blink::WebURLResponse* response, + blink::WebURLError* error, + blink::WebData* data); + void LoadAsynchronouly(const blink::WebURLRequest& request, WebURLLoaderMock* loader); // Removes the loader from the list of pending loaders. @@ -76,37 +76,37 @@ class WebURLLoaderMockFactory { private: struct ResponseInfo { - WebKit::WebURLResponse response; + blink::WebURLResponse response; base::FilePath file_path; }; // Loads the specified request and populates the response, error and data // accordingly. - void LoadRequest(const WebKit::WebURLRequest& request, - WebKit::WebURLResponse* response, - WebKit::WebURLError* error, - WebKit::WebData* data); + void LoadRequest(const blink::WebURLRequest& request, + blink::WebURLResponse* response, + blink::WebURLError* error, + blink::WebData* data); // Checks if the loader is pending. Otherwise, it may have been deleted. bool IsPending(WebURLLoaderMock* loader); // Reads |m_filePath| and puts its content in |data|. // Returns true if it successfully read the file. - static bool ReadFile(const base::FilePath& file_path, WebKit::WebData* data); + static bool ReadFile(const base::FilePath& file_path, blink::WebData* data); // The loaders that have not being served data yet. - typedef std::map<WebURLLoaderMock*, WebKit::WebURLRequest> LoaderToRequestMap; + typedef std::map<WebURLLoaderMock*, blink::WebURLRequest> LoaderToRequestMap; LoaderToRequestMap pending_loaders_; - typedef std::map<GURL, WebKit::WebURLError> URLToErrorMap; + typedef std::map<GURL, blink::WebURLError> URLToErrorMap; URLToErrorMap url_to_error_info_; // Table of the registered URLs and the responses that they should receive. typedef std::map<GURL, ResponseInfo> URLToResponseMap; URLToResponseMap url_to_reponse_info_; - WebKit::WebURLRequest last_handled_asynchronous_request_; + blink::WebURLRequest last_handled_asynchronous_request_; DISALLOW_COPY_AND_ASSIGN(WebURLLoaderMockFactory); }; |