OLD | NEW |
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 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 const Color transparentRed(100, 0, 0, 0); | 532 const Color transparentRed(100, 0, 0, 0); |
533 frame->createView(IntSize(1024, 768), transparentRed, true); | 533 frame->createView(IntSize(1024, 768), transparentRed, true); |
534 EXPECT_EQ(transparentRed, frame->view()->baseBackgroundColor()); | 534 EXPECT_EQ(transparentRed, frame->view()->baseBackgroundColor()); |
535 frame->view()->dispose(); | 535 frame->view()->dispose(); |
536 } | 536 } |
537 | 537 |
538 TEST_F(WebViewTest, SetBaseBackgroundColorBeforeMainFrame) | 538 TEST_F(WebViewTest, SetBaseBackgroundColorBeforeMainFrame) |
539 { | 539 { |
540 const WebColor kBlue = 0xFF0000FF; | 540 const WebColor kBlue = 0xFF0000FF; |
541 FrameTestHelpers::TestWebViewClient webViewClient; | 541 FrameTestHelpers::TestWebViewClient webViewClient; |
542 WebViewImpl* webView = WebViewImpl::create(&webViewClient); | 542 WebViewImpl* webView = WebViewImpl::create(&webViewClient, true); |
543 EXPECT_NE(kBlue, webView->backgroundColor()); | 543 EXPECT_NE(kBlue, webView->backgroundColor()); |
544 // webView does not have a frame yet, but we should still be able to set the
background color. | 544 // webView does not have a frame yet, but we should still be able to set the
background color. |
545 webView->setBaseBackgroundColor(kBlue); | 545 webView->setBaseBackgroundColor(kBlue); |
546 EXPECT_EQ(kBlue, webView->backgroundColor()); | 546 EXPECT_EQ(kBlue, webView->backgroundColor()); |
547 WebLocalFrame* frame = WebLocalFrame::create(WebTreeScopeType::Document, nul
lptr); | 547 WebLocalFrame* frame = WebLocalFrame::create(WebTreeScopeType::Document, nul
lptr); |
548 webView->setMainFrame(frame); | 548 webView->setMainFrame(frame); |
549 webView->close(); | 549 webView->close(); |
550 frame->close(); | 550 frame->close(); |
551 } | 551 } |
552 | 552 |
(...skipping 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1590 webView->handleInputEvent(event); | 1590 webView->handleInputEvent(event); |
1591 runPendingTasks(); | 1591 runPendingTasks(); |
1592 EXPECT_EQ(25, client.longpressX()); | 1592 EXPECT_EQ(25, client.longpressX()); |
1593 EXPECT_EQ(7, client.longpressY()); | 1593 EXPECT_EQ(7, client.longpressY()); |
1594 | 1594 |
1595 m_webViewHelper.reset(); // Explicitly reset to break dependency on locally
scoped client. | 1595 m_webViewHelper.reset(); // Explicitly reset to break dependency on locally
scoped client. |
1596 } | 1596 } |
1597 | 1597 |
1598 TEST_F(WebViewTest, ClientTapHandlingNullWebViewClient) | 1598 TEST_F(WebViewTest, ClientTapHandlingNullWebViewClient) |
1599 { | 1599 { |
1600 WebViewImpl* webView = WebViewImpl::create(nullptr); | 1600 WebViewImpl* webView = WebViewImpl::create(nullptr, true); |
1601 WebLocalFrame* localFrame = WebLocalFrame::create(WebTreeScopeType::Document
, nullptr); | 1601 WebLocalFrame* localFrame = WebLocalFrame::create(WebTreeScopeType::Document
, nullptr); |
1602 webView->setMainFrame(localFrame); | 1602 webView->setMainFrame(localFrame); |
1603 WebGestureEvent event; | 1603 WebGestureEvent event; |
1604 event.type = WebInputEvent::GestureTap; | 1604 event.type = WebInputEvent::GestureTap; |
1605 event.sourceDevice = WebGestureDeviceTouchscreen; | 1605 event.sourceDevice = WebGestureDeviceTouchscreen; |
1606 event.x = 3; | 1606 event.x = 3; |
1607 event.y = 8; | 1607 event.y = 8; |
1608 EXPECT_EQ(WebInputEventResult::NotHandled, webView->handleInputEvent(event))
; | 1608 EXPECT_EQ(WebInputEventResult::NotHandled, webView->handleInputEvent(event))
; |
1609 webView->close(); | 1609 webView->close(); |
1610 // Explicitly close as the frame as no frame client to do so on frameDetache
d(). | 1610 // Explicitly close as the frame as no frame client to do so on frameDetache
d(). |
(...skipping 1570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3181 frame->setAutofillClient(&client); | 3181 frame->setAutofillClient(&client); |
3182 webView->setInitialFocus(false); | 3182 webView->setInitialFocus(false); |
3183 | 3183 |
3184 EXPECT_TRUE(webView->confirmComposition(WebString::fromUTF8(std::string("hel
lo").c_str()))); | 3184 EXPECT_TRUE(webView->confirmComposition(WebString::fromUTF8(std::string("hel
lo").c_str()))); |
3185 EXPECT_EQ(1, client.textChangesFromUserGesture()); | 3185 EXPECT_EQ(1, client.textChangesFromUserGesture()); |
3186 EXPECT_FALSE(UserGestureIndicator::processingUserGesture()); | 3186 EXPECT_FALSE(UserGestureIndicator::processingUserGesture()); |
3187 frame->setAutofillClient(0); | 3187 frame->setAutofillClient(0); |
3188 } | 3188 } |
3189 | 3189 |
3190 } // namespace blink | 3190 } // namespace blink |
OLD | NEW |