| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 #include "public/web/WebDateTimeChooserCompletion.h" | 73 #include "public/web/WebDateTimeChooserCompletion.h" |
| 74 #include "public/web/WebDocument.h" | 74 #include "public/web/WebDocument.h" |
| 75 #include "public/web/WebDragOperation.h" | 75 #include "public/web/WebDragOperation.h" |
| 76 #include "public/web/WebElement.h" | 76 #include "public/web/WebElement.h" |
| 77 #include "public/web/WebFrame.h" | 77 #include "public/web/WebFrame.h" |
| 78 #include "public/web/WebFrameClient.h" | 78 #include "public/web/WebFrameClient.h" |
| 79 #include "public/web/WebHitTestResult.h" | 79 #include "public/web/WebHitTestResult.h" |
| 80 #include "public/web/WebInputEvent.h" | 80 #include "public/web/WebInputEvent.h" |
| 81 #include "public/web/WebScriptSource.h" | 81 #include "public/web/WebScriptSource.h" |
| 82 #include "public/web/WebSettings.h" | 82 #include "public/web/WebSettings.h" |
| 83 #include "public/web/WebTreeScopeType.h" |
| 83 #include "public/web/WebViewClient.h" | 84 #include "public/web/WebViewClient.h" |
| 84 #include "public/web/WebWidget.h" | 85 #include "public/web/WebWidget.h" |
| 85 #include "public/web/WebWidgetClient.h" | 86 #include "public/web/WebWidgetClient.h" |
| 86 #include "third_party/skia/include/core/SkBitmap.h" | 87 #include "third_party/skia/include/core/SkBitmap.h" |
| 87 #include "third_party/skia/include/core/SkBitmapDevice.h" | 88 #include "third_party/skia/include/core/SkBitmapDevice.h" |
| 88 #include "third_party/skia/include/core/SkCanvas.h" | 89 #include "third_party/skia/include/core/SkCanvas.h" |
| 89 #include "web/WebLocalFrameImpl.h" | 90 #include "web/WebLocalFrameImpl.h" |
| 90 #include "web/WebSettingsImpl.h" | 91 #include "web/WebSettingsImpl.h" |
| 91 #include "web/WebViewImpl.h" | 92 #include "web/WebViewImpl.h" |
| 92 #include "web/tests/FrameTestHelpers.h" | 93 #include "web/tests/FrameTestHelpers.h" |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 | 492 |
| 492 TEST_F(WebViewTest, SetBaseBackgroundColorBeforeMainFrame) | 493 TEST_F(WebViewTest, SetBaseBackgroundColorBeforeMainFrame) |
| 493 { | 494 { |
| 494 const WebColor kBlue = 0xFF0000FF; | 495 const WebColor kBlue = 0xFF0000FF; |
| 495 FrameTestHelpers::TestWebViewClient webViewClient; | 496 FrameTestHelpers::TestWebViewClient webViewClient; |
| 496 WebView* webView = WebViewImpl::create(&webViewClient); | 497 WebView* webView = WebViewImpl::create(&webViewClient); |
| 497 EXPECT_NE(kBlue, webView->backgroundColor()); | 498 EXPECT_NE(kBlue, webView->backgroundColor()); |
| 498 // webView does not have a frame yet, but we should still be able to set the
background color. | 499 // webView does not have a frame yet, but we should still be able to set the
background color. |
| 499 webView->setBaseBackgroundColor(kBlue); | 500 webView->setBaseBackgroundColor(kBlue); |
| 500 EXPECT_EQ(kBlue, webView->backgroundColor()); | 501 EXPECT_EQ(kBlue, webView->backgroundColor()); |
| 501 WebLocalFrameImpl* frame = WebLocalFrameImpl::create(0); | 502 WebLocalFrameImpl* frame = WebLocalFrameImpl::create(WebTreeScopeType::Docum
ent, nullptr); |
| 502 webView->setMainFrame(frame); | 503 webView->setMainFrame(frame); |
| 503 webView->close(); | 504 webView->close(); |
| 504 frame->close(); | 505 frame->close(); |
| 505 } | 506 } |
| 506 | 507 |
| 507 TEST_F(WebViewTest, SetBaseBackgroundColorAndBlendWithExistingContent) | 508 TEST_F(WebViewTest, SetBaseBackgroundColorAndBlendWithExistingContent) |
| 508 { | 509 { |
| 509 const WebColor kAlphaRed = 0x80FF0000; | 510 const WebColor kAlphaRed = 0x80FF0000; |
| 510 const WebColor kAlphaGreen = 0x8000FF00; | 511 const WebColor kAlphaGreen = 0x8000FF00; |
| 511 const int kWidth = 100; | 512 const int kWidth = 100; |
| (...skipping 2479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2991 for (size_t i = 0; i < renders.size(); ++i) { | 2992 for (size_t i = 0; i < renders.size(); ++i) { |
| 2992 double docStartTime = frame->domWindow()->document()->loader()->timing()
.monotonicTimeToZeroBasedDocumentTime(renderPairs[i].startTime) * 1000.0; | 2993 double docStartTime = frame->domWindow()->document()->loader()->timing()
.monotonicTimeToZeroBasedDocumentTime(renderPairs[i].startTime) * 1000.0; |
| 2993 ASSERT_DOUBLE_EQ(docStartTime, renders[i]->startTime()); | 2994 ASSERT_DOUBLE_EQ(docStartTime, renders[i]->startTime()); |
| 2994 double docFinishTime = frame->domWindow()->document()->loader()->timing(
).monotonicTimeToZeroBasedDocumentTime(renderPairs[i].finishTime) * 1000.0; | 2995 double docFinishTime = frame->domWindow()->document()->loader()->timing(
).monotonicTimeToZeroBasedDocumentTime(renderPairs[i].finishTime) * 1000.0; |
| 2995 double docDuration = docFinishTime - docStartTime; | 2996 double docDuration = docFinishTime - docStartTime; |
| 2996 ASSERT_DOUBLE_EQ(docDuration, renders[i]->duration()); | 2997 ASSERT_DOUBLE_EQ(docDuration, renders[i]->duration()); |
| 2997 } | 2998 } |
| 2998 } | 2999 } |
| 2999 | 3000 |
| 3000 } // namespace | 3001 } // namespace |
| OLD | NEW |