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 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 EXPECT_TRUE(frame->frame()->document()->isHTMLDocument()); | 414 EXPECT_TRUE(frame->frame()->document()->isHTMLDocument()); |
415 | 415 |
416 EXPECT_EQ(expectedWidth, client.testData().width()); | 416 EXPECT_EQ(expectedWidth, client.testData().width()); |
417 EXPECT_EQ(expectedHeight, client.testData().height()); | 417 EXPECT_EQ(expectedHeight, client.testData().height()); |
418 EXPECT_EQ(expectedHorizontalState, client.testData().horizontalScrollbarStat
e()); | 418 EXPECT_EQ(expectedHorizontalState, client.testData().horizontalScrollbarStat
e()); |
419 EXPECT_EQ(expectedVerticalState, client.testData().verticalScrollbarState())
; | 419 EXPECT_EQ(expectedVerticalState, client.testData().verticalScrollbarState())
; |
420 | 420 |
421 m_webViewHelper.reset(); // Explicitly reset to break dependency on locally
scoped client. | 421 m_webViewHelper.reset(); // Explicitly reset to break dependency on locally
scoped client. |
422 } | 422 } |
423 | 423 |
424 TEST_F(WebViewTest, DISABLED_AutoResizeMinimumSize) | 424 TEST_F(WebViewTest, AutoResizeMinimumSize) |
425 { | 425 { |
426 WebSize minAutoResize(91, 56); | 426 WebSize minAutoResize(91, 56); |
427 WebSize maxAutoResize(403, 302); | 427 WebSize maxAutoResize(403, 302); |
428 std::string pageWidth = "91px"; | 428 std::string pageWidth = "91px"; |
429 std::string pageHeight = "56px"; | 429 std::string pageHeight = "56px"; |
430 int expectedWidth = 91; | 430 int expectedWidth = 91; |
431 int expectedHeight = 56; | 431 int expectedHeight = 56; |
432 testAutoResize(minAutoResize, maxAutoResize, pageWidth, pageHeight, | 432 testAutoResize(minAutoResize, maxAutoResize, pageWidth, pageHeight, |
433 expectedWidth, expectedHeight, NoHorizontalScrollbar, NoVerti
calScrollbar); | 433 expectedWidth, expectedHeight, NoHorizontalScrollbar, NoVerti
calScrollbar); |
434 } | 434 } |
(...skipping 17 matching lines...) Expand all Loading... |
452 std::string pageWidth = "300px"; | 452 std::string pageWidth = "300px"; |
453 std::string pageHeight = "80px"; | 453 std::string pageHeight = "80px"; |
454 int expectedWidth = 200; | 454 int expectedWidth = 200; |
455 int expectedHeight = 100; | 455 int expectedHeight = 100; |
456 testAutoResize(minAutoResize, maxAutoResize, pageWidth, pageHeight, | 456 testAutoResize(minAutoResize, maxAutoResize, pageWidth, pageHeight, |
457 expectedWidth, expectedHeight, VisibleHorizontalScrollbar, No
VerticalScrollbar); | 457 expectedWidth, expectedHeight, VisibleHorizontalScrollbar, No
VerticalScrollbar); |
458 } | 458 } |
459 | 459 |
460 // Next three tests disabled for https://bugs.webkit.org/show_bug.cgi?id=92318 . | 460 // Next three tests disabled for https://bugs.webkit.org/show_bug.cgi?id=92318 . |
461 // It seems we can run three AutoResize tests, then the next one breaks. | 461 // It seems we can run three AutoResize tests, then the next one breaks. |
462 TEST_F(WebViewTest, DISABLED_AutoResizeInBetweenSizes) | 462 TEST_F(WebViewTest, AutoResizeInBetweenSizes) |
463 { | 463 { |
464 WebSize minAutoResize(90, 95); | 464 WebSize minAutoResize(90, 95); |
465 WebSize maxAutoResize(200, 300); | 465 WebSize maxAutoResize(200, 300); |
466 std::string pageWidth = "100px"; | 466 std::string pageWidth = "100px"; |
467 std::string pageHeight = "200px"; | 467 std::string pageHeight = "200px"; |
468 int expectedWidth = 100; | 468 int expectedWidth = 100; |
469 int expectedHeight = 200; | 469 int expectedHeight = 200; |
470 testAutoResize(minAutoResize, maxAutoResize, pageWidth, pageHeight, | 470 testAutoResize(minAutoResize, maxAutoResize, pageWidth, pageHeight, |
471 expectedWidth, expectedHeight, NoHorizontalScrollbar, NoVerti
calScrollbar); | 471 expectedWidth, expectedHeight, NoHorizontalScrollbar, NoVerti
calScrollbar); |
472 } | 472 } |
473 | 473 |
474 TEST_F(WebViewTest, DISABLED_AutoResizeOverflowSizes) | 474 TEST_F(WebViewTest, AutoResizeOverflowSizes) |
475 { | 475 { |
476 WebSize minAutoResize(90, 95); | 476 WebSize minAutoResize(90, 95); |
477 WebSize maxAutoResize(200, 300); | 477 WebSize maxAutoResize(200, 300); |
478 std::string pageWidth = "300px"; | 478 std::string pageWidth = "300px"; |
479 std::string pageHeight = "400px"; | 479 std::string pageHeight = "400px"; |
480 int expectedWidth = 200; | 480 int expectedWidth = 200; |
481 int expectedHeight = 300; | 481 int expectedHeight = 300; |
482 testAutoResize(minAutoResize, maxAutoResize, pageWidth, pageHeight, | 482 testAutoResize(minAutoResize, maxAutoResize, pageWidth, pageHeight, |
483 expectedWidth, expectedHeight, VisibleHorizontalScrollbar, Vi
sibleVerticalScrollbar); | 483 expectedWidth, expectedHeight, VisibleHorizontalScrollbar, Vi
sibleVerticalScrollbar); |
484 } | 484 } |
485 | 485 |
486 TEST_F(WebViewTest, DISABLED_AutoResizeMaxSize) | 486 TEST_F(WebViewTest, AutoResizeMaxSize) |
487 { | 487 { |
488 WebSize minAutoResize(90, 95); | 488 WebSize minAutoResize(90, 95); |
489 WebSize maxAutoResize(200, 300); | 489 WebSize maxAutoResize(200, 300); |
490 std::string pageWidth = "200px"; | 490 std::string pageWidth = "200px"; |
491 std::string pageHeight = "300px"; | 491 std::string pageHeight = "300px"; |
492 int expectedWidth = 200; | 492 int expectedWidth = 200; |
493 int expectedHeight = 300; | 493 int expectedHeight = 300; |
494 testAutoResize(minAutoResize, maxAutoResize, pageWidth, pageHeight, | 494 testAutoResize(minAutoResize, maxAutoResize, pageWidth, pageHeight, |
495 expectedWidth, expectedHeight, NoHorizontalScrollbar, NoVerti
calScrollbar); | 495 expectedWidth, expectedHeight, NoHorizontalScrollbar, NoVerti
calScrollbar); |
496 } | 496 } |
(...skipping 1667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2164 WebLocalFrameImpl* frame = toWebLocalFrameImpl(webView->mainFrame()); | 2164 WebLocalFrameImpl* frame = toWebLocalFrameImpl(webView->mainFrame()); |
2165 frame->executeScript(WebScriptSource(WebString::fromUTF8("document.execComma
nd('SelectAll', false, null)"))); | 2165 frame->executeScript(WebScriptSource(WebString::fromUTF8("document.execComma
nd('SelectAll', false, null)"))); |
2166 std::string actual = frame->selectionAsText().utf8(); | 2166 std::string actual = frame->selectionAsText().utf8(); |
2167 | 2167 |
2168 const int kMaxOutputCharacters = 1024; | 2168 const int kMaxOutputCharacters = 1024; |
2169 std::string expected = frame->contentAsText(kMaxOutputCharacters).utf8(); | 2169 std::string expected = frame->contentAsText(kMaxOutputCharacters).utf8(); |
2170 EXPECT_EQ(expected, actual); | 2170 EXPECT_EQ(expected, actual); |
2171 } | 2171 } |
2172 | 2172 |
2173 } // namespace | 2173 } // namespace |
OLD | NEW |