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

Side by Side Diff: third_party/WebKit/Source/web/tests/WebViewTest.cpp

Issue 2651583007: Plumbing blink::Interface{Provider|Registry} through WebLocalFrame's constructor. (Closed)
Patch Set: Rebasing... Created 3 years, 10 months 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 const WebColor kBlue = 0xFF0000FF; 431 const WebColor kBlue = 0xFF0000FF;
432 FrameTestHelpers::TestWebViewClient webViewClient; 432 FrameTestHelpers::TestWebViewClient webViewClient;
433 WebViewImpl* webView = 433 WebViewImpl* webView =
434 WebViewImpl::create(&webViewClient, WebPageVisibilityStateVisible); 434 WebViewImpl::create(&webViewClient, WebPageVisibilityStateVisible);
435 EXPECT_NE(kBlue, webView->backgroundColor()); 435 EXPECT_NE(kBlue, webView->backgroundColor());
436 // webView does not have a frame yet, but we should still be able to set the 436 // webView does not have a frame yet, but we should still be able to set the
437 // background color. 437 // background color.
438 webView->setBaseBackgroundColor(kBlue); 438 webView->setBaseBackgroundColor(kBlue);
439 EXPECT_EQ(kBlue, webView->backgroundColor()); 439 EXPECT_EQ(kBlue, webView->backgroundColor());
440 FrameTestHelpers::TestWebFrameClient webFrameClient; 440 FrameTestHelpers::TestWebFrameClient webFrameClient;
441 WebLocalFrame* frame = 441 WebLocalFrame* frame = WebLocalFrame::create(
442 WebLocalFrame::create(WebTreeScopeType::Document, &webFrameClient); 442 WebTreeScopeType::Document, &webFrameClient, nullptr, nullptr);
443 webView->setMainFrame(frame); 443 webView->setMainFrame(frame);
444 webView->close(); 444 webView->close();
445 } 445 }
446 446
447 TEST_P(WebViewTest, SetBaseBackgroundColorAndBlendWithExistingContent) { 447 TEST_P(WebViewTest, SetBaseBackgroundColorAndBlendWithExistingContent) {
448 const WebColor kAlphaRed = 0x80FF0000; 448 const WebColor kAlphaRed = 0x80FF0000;
449 const WebColor kAlphaGreen = 0x8000FF00; 449 const WebColor kAlphaGreen = 0x8000FF00;
450 const int kWidth = 100; 450 const int kWidth = 100;
451 const int kHeight = 100; 451 const int kHeight = 100;
452 452
(...skipping 1691 matching lines...) Expand 10 before | Expand all | Expand 10 after
2144 2144
2145 // Explicitly reset to break dependency on locally scoped client. 2145 // Explicitly reset to break dependency on locally scoped client.
2146 m_webViewHelper.reset(); 2146 m_webViewHelper.reset();
2147 } 2147 }
2148 2148
2149 TEST_P(WebViewTest, ClientTapHandlingNullWebViewClient) { 2149 TEST_P(WebViewTest, ClientTapHandlingNullWebViewClient) {
2150 WebViewImpl* webView = 2150 WebViewImpl* webView =
2151 WebViewImpl::create(nullptr, WebPageVisibilityStateVisible); 2151 WebViewImpl::create(nullptr, WebPageVisibilityStateVisible);
2152 FrameTestHelpers::TestWebFrameClient webFrameClient; 2152 FrameTestHelpers::TestWebFrameClient webFrameClient;
2153 FrameTestHelpers::TestWebWidgetClient webWidgetClient; 2153 FrameTestHelpers::TestWebWidgetClient webWidgetClient;
2154 WebLocalFrame* localFrame = 2154 WebLocalFrame* localFrame = WebLocalFrame::create(
2155 WebLocalFrame::create(WebTreeScopeType::Document, &webFrameClient); 2155 WebTreeScopeType::Document, &webFrameClient, nullptr, nullptr);
2156 webView->setMainFrame(localFrame); 2156 webView->setMainFrame(localFrame);
2157 2157
2158 // TODO(dcheng): The main frame widget currently has a special case. 2158 // TODO(dcheng): The main frame widget currently has a special case.
2159 // Eliminate this once WebView is no longer a WebWidget. 2159 // Eliminate this once WebView is no longer a WebWidget.
2160 blink::WebFrameWidget::create(&webWidgetClient, webView, localFrame); 2160 blink::WebFrameWidget::create(&webWidgetClient, webView, localFrame);
2161 2161
2162 WebGestureEvent event(WebInputEvent::GestureTap, WebInputEvent::NoModifiers, 2162 WebGestureEvent event(WebInputEvent::GestureTap, WebInputEvent::NoModifiers,
2163 WebInputEvent::TimeStampForTesting); 2163 WebInputEvent::TimeStampForTesting);
2164 event.sourceDevice = WebGestureDeviceTouchscreen; 2164 event.sourceDevice = WebGestureDeviceTouchscreen;
2165 event.x = 3; 2165 event.x = 3;
(...skipping 2216 matching lines...) Expand 10 before | Expand all | Expand 10 after
4382 EXPECT_EQ(expectedWidth, vwElement->offsetWidth()); 4382 EXPECT_EQ(expectedWidth, vwElement->offsetWidth());
4383 EXPECT_EQ(expectedHeight, vwElement->offsetHeight()); 4383 EXPECT_EQ(expectedHeight, vwElement->offsetHeight());
4384 4384
4385 webView->resize(WebSize(800, 600)); 4385 webView->resize(WebSize(800, 600));
4386 frame->printEnd(); 4386 frame->printEnd();
4387 4387
4388 EXPECT_EQ(800, vwElement->offsetWidth()); 4388 EXPECT_EQ(800, vwElement->offsetWidth());
4389 } 4389 }
4390 4390
4391 } // namespace blink 4391 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/tests/WebFrameTest.cpp ('k') | third_party/WebKit/public/web/WebFrameClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698