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 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 LocalFrame* frame = webView->mainFrameImpl()->frame(); | 514 LocalFrame* frame = webView->mainFrameImpl()->frame(); |
515 // The detach() and dispose() calls are a hack to prevent this test | 515 // The detach() and dispose() calls are a hack to prevent this test |
516 // from violating invariants about frame state during navigation/detach. | 516 // from violating invariants about frame state during navigation/detach. |
517 frame->document()->detach(); | 517 frame->document()->detach(); |
518 | 518 |
519 // Creating a new frame view with the background color having 0 alpha. | 519 // Creating a new frame view with the background color having 0 alpha. |
520 frame->createView(IntSize(1024, 768), Color::transparent, true); | 520 frame->createView(IntSize(1024, 768), Color::transparent, true); |
521 EXPECT_EQ(kTransparent, frame->view()->baseBackgroundColor()); | 521 EXPECT_EQ(kTransparent, frame->view()->baseBackgroundColor()); |
522 frame->view()->dispose(); | 522 frame->view()->dispose(); |
523 | 523 |
524 Color kTransparentRed(100, 0, 0, 0); | 524 const Color kTransparentRed(100, 0, 0, 0); |
525 frame->createView(IntSize(1024, 768), kTransparentRed, true); | 525 frame->createView(IntSize(1024, 768), kTransparentRed, true); |
526 EXPECT_EQ(kTransparentRed, frame->view()->baseBackgroundColor()); | 526 EXPECT_EQ(kTransparentRed, frame->view()->baseBackgroundColor()); |
527 frame->view()->dispose(); | 527 frame->view()->dispose(); |
528 } | 528 } |
529 | 529 |
530 TEST_F(WebViewTest, SetBaseBackgroundColorBeforeMainFrame) | 530 TEST_F(WebViewTest, SetBaseBackgroundColorBeforeMainFrame) |
531 { | 531 { |
532 const WebColor kBlue = 0xFF0000FF; | 532 const WebColor kBlue = 0xFF0000FF; |
533 FrameTestHelpers::TestWebViewClient webViewClient; | 533 FrameTestHelpers::TestWebViewClient webViewClient; |
534 WebView* webView = WebViewImpl::create(&webViewClient); | 534 WebView* webView = WebViewImpl::create(&webViewClient); |
(...skipping 1559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2094 webView->setFocus(false); | 2094 webView->setFocus(false); |
2095 webView->setFocus(true); | 2095 webView->setFocus(true); |
2096 | 2096 |
2097 WebElement element = webView->mainFrame()->document().getElementById("messag
e"); | 2097 WebElement element = webView->mainFrame()->document().getElementById("messag
e"); |
2098 // Expect not to see duplication of events. | 2098 // Expect not to see duplication of events. |
2099 EXPECT_STREQ("blurfocus", element.textContent().utf8().data()); | 2099 EXPECT_STREQ("blurfocus", element.textContent().utf8().data()); |
2100 } | 2100 } |
2101 | 2101 |
2102 TEST_F(WebViewTest, SmartClipData) | 2102 TEST_F(WebViewTest, SmartClipData) |
2103 { | 2103 { |
2104 static const char* kExpectedClipText = "\nPrice 10,000,000won"; | 2104 static const char kExpectedClipText[] = "\nPrice 10,000,000won"; |
2105 static const char* kExpectedClipHtml = | 2105 static const char kExpectedClipHtml[] = |
2106 "<div id=\"div4\" style=\"padding: 10px; margin: 10px; border: 2px " | 2106 "<div id=\"div4\" style=\"padding: 10px; margin: 10px; border: 2px " |
2107 "solid skyblue; float: left; width: 190px; height: 30px; " | 2107 "solid skyblue; float: left; width: 190px; height: 30px; " |
2108 "color: rgb(0, 0, 0); font-family: myahem; font-size: 8px; font-style: " | 2108 "color: rgb(0, 0, 0); font-family: myahem; font-size: 8px; font-style: " |
2109 "normal; font-variant: normal; font-weight: normal; letter-spacing: " | 2109 "normal; font-variant: normal; font-weight: normal; letter-spacing: " |
2110 "normal; line-height: normal; orphans: auto; text-align: start; " | 2110 "normal; line-height: normal; orphans: auto; text-align: start; " |
2111 "text-indent: 0px; text-transform: none; white-space: normal; widows: " | 2111 "text-indent: 0px; text-transform: none; white-space: normal; widows: " |
2112 "1; word-spacing: 0px; -webkit-text-stroke-width: 0px;\">Air " | 2112 "1; word-spacing: 0px; -webkit-text-stroke-width: 0px;\">Air " |
2113 "conditioner</div><div id=\"div5\" style=\"padding: 10px; margin: " | 2113 "conditioner</div><div id=\"div5\" style=\"padding: 10px; margin: " |
2114 "10px; border: 2px solid skyblue; float: left; width: " | 2114 "10px; border: 2px solid skyblue; float: left; width: " |
2115 "190px; height: 30px; color: rgb(0, 0, 0); font-family: myahem; " | 2115 "190px; height: 30px; color: rgb(0, 0, 0); font-family: myahem; " |
(...skipping 1061 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3177 WebFrame* frame = mainWebView.webView()->mainFrame(); | 3177 WebFrame* frame = mainWebView.webView()->mainFrame(); |
3178 v8::HandleScope scope(v8::Isolate::GetCurrent()); | 3178 v8::HandleScope scope(v8::Isolate::GetCurrent()); |
3179 v8::Local<v8::Value> v8Value = frame->executeScriptAndReturnValue(WebScriptS
ource("var win = window.open('javascript:false'); win.document")); | 3179 v8::Local<v8::Value> v8Value = frame->executeScriptAndReturnValue(WebScriptS
ource("var win = window.open('javascript:false'); win.document")); |
3180 ASSERT_TRUE(v8Value->IsObject()); | 3180 ASSERT_TRUE(v8Value->IsObject()); |
3181 Document* document = V8Document::toImplWithTypeCheck(v8::Isolate::GetCurrent
(), v8Value); | 3181 Document* document = V8Document::toImplWithTypeCheck(v8::Isolate::GetCurrent
(), v8Value); |
3182 ASSERT_TRUE(document); | 3182 ASSERT_TRUE(document); |
3183 EXPECT_FALSE(document->frame()->isLoading()); | 3183 EXPECT_FALSE(document->frame()->isLoading()); |
3184 } | 3184 } |
3185 | 3185 |
3186 } // namespace blink | 3186 } // namespace blink |
OLD | NEW |