| 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 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 | 534 |
| 535 TEST_F(WebViewTest, SetBaseBackgroundColorBeforeMainFrame) | 535 TEST_F(WebViewTest, SetBaseBackgroundColorBeforeMainFrame) |
| 536 { | 536 { |
| 537 const WebColor kBlue = 0xFF0000FF; | 537 const WebColor kBlue = 0xFF0000FF; |
| 538 FrameTestHelpers::TestWebViewClient webViewClient; | 538 FrameTestHelpers::TestWebViewClient webViewClient; |
| 539 WebViewImpl* webView = WebViewImpl::create(&webViewClient); | 539 WebViewImpl* webView = WebViewImpl::create(&webViewClient); |
| 540 EXPECT_NE(kBlue, webView->backgroundColor()); | 540 EXPECT_NE(kBlue, webView->backgroundColor()); |
| 541 // webView does not have a frame yet, but we should still be able to set the
background color. | 541 // webView does not have a frame yet, but we should still be able to set the
background color. |
| 542 webView->setBaseBackgroundColor(kBlue); | 542 webView->setBaseBackgroundColor(kBlue); |
| 543 EXPECT_EQ(kBlue, webView->backgroundColor()); | 543 EXPECT_EQ(kBlue, webView->backgroundColor()); |
| 544 WebLocalFrameImpl* frame = WebLocalFrameImpl::create(WebTreeScopeType::Docum
ent, nullptr); | 544 WebLocalFrame* frame = WebLocalFrame::create(WebTreeScopeType::Document, nul
lptr); |
| 545 webView->setMainFrame(frame); | 545 webView->setMainFrame(frame); |
| 546 webView->close(); | 546 webView->close(); |
| 547 frame->close(); | 547 frame->close(); |
| 548 } | 548 } |
| 549 | 549 |
| 550 TEST_F(WebViewTest, SetBaseBackgroundColorAndBlendWithExistingContent) | 550 TEST_F(WebViewTest, SetBaseBackgroundColorAndBlendWithExistingContent) |
| 551 { | 551 { |
| 552 const WebColor kAlphaRed = 0x80FF0000; | 552 const WebColor kAlphaRed = 0x80FF0000; |
| 553 const WebColor kAlphaGreen = 0x8000FF00; | 553 const WebColor kAlphaGreen = 0x8000FF00; |
| 554 const int kWidth = 100; | 554 const int kWidth = 100; |
| (...skipping 1348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1903 } | 1903 } |
| 1904 | 1904 |
| 1905 class ViewCreatingWebViewClient : public FrameTestHelpers::TestWebViewClient { | 1905 class ViewCreatingWebViewClient : public FrameTestHelpers::TestWebViewClient { |
| 1906 public: | 1906 public: |
| 1907 ViewCreatingWebViewClient() | 1907 ViewCreatingWebViewClient() |
| 1908 : m_didFocusCalled(false) | 1908 : m_didFocusCalled(false) |
| 1909 { | 1909 { |
| 1910 } | 1910 } |
| 1911 | 1911 |
| 1912 // WebViewClient methods | 1912 // WebViewClient methods |
| 1913 WebView* createView(WebLocalFrame*, const WebURLRequest&, const WebWindowFea
tures&, const WebString& name, WebNavigationPolicy, bool) override | 1913 WebView* createView(WebLocalFrame* opener, const WebURLRequest&, const WebWi
ndowFeatures&, const WebString& name, WebNavigationPolicy, bool) override |
| 1914 { | 1914 { |
| 1915 return m_webViewHelper.initialize(true, 0, 0); | 1915 return m_webViewHelper.initializeWithOpener(opener, true); |
| 1916 } | 1916 } |
| 1917 | 1917 |
| 1918 // WebWidgetClient methods | 1918 // WebWidgetClient methods |
| 1919 void didFocus() override | 1919 void didFocus() override |
| 1920 { | 1920 { |
| 1921 m_didFocusCalled = true; | 1921 m_didFocusCalled = true; |
| 1922 } | 1922 } |
| 1923 | 1923 |
| 1924 bool didFocusCalled() const { return m_didFocusCalled; } | 1924 bool didFocusCalled() const { return m_didFocusCalled; } |
| 1925 WebView* createdWebView() const { return m_webViewHelper.webView(); } | 1925 WebView* createdWebView() const { return m_webViewHelper.webView(); } |
| (...skipping 1300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3226 frame->setAutofillClient(&client); | 3226 frame->setAutofillClient(&client); |
| 3227 webView->setInitialFocus(false); | 3227 webView->setInitialFocus(false); |
| 3228 | 3228 |
| 3229 EXPECT_TRUE(webView->confirmComposition(WebString::fromUTF8(std::string("hel
lo").c_str()))); | 3229 EXPECT_TRUE(webView->confirmComposition(WebString::fromUTF8(std::string("hel
lo").c_str()))); |
| 3230 EXPECT_EQ(1, client.textChangesFromUserGesture()); | 3230 EXPECT_EQ(1, client.textChangesFromUserGesture()); |
| 3231 EXPECT_FALSE(UserGestureIndicator::processingUserGesture()); | 3231 EXPECT_FALSE(UserGestureIndicator::processingUserGesture()); |
| 3232 frame->setAutofillClient(0); | 3232 frame->setAutofillClient(0); |
| 3233 } | 3233 } |
| 3234 | 3234 |
| 3235 } // namespace blink | 3235 } // namespace blink |
| OLD | NEW |