Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(283)

Side by Side Diff: third_party/WebKit/Source/web/tests/WebFrameTest.cpp

Issue 2408333004: Move persistent gesture state to Document, add DocumentUserGestureToken (Closed)
Patch Set: Re-add dropped null check Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 21 matching lines...) Expand all
32 32
33 #include "SkBitmap.h" 33 #include "SkBitmap.h"
34 #include "SkCanvas.h" 34 #include "SkCanvas.h"
35 #include "bindings/core/v8/SerializedScriptValueFactory.h" 35 #include "bindings/core/v8/SerializedScriptValueFactory.h"
36 #include "bindings/core/v8/V8Node.h" 36 #include "bindings/core/v8/V8Node.h"
37 #include "core/clipboard/DataTransfer.h" 37 #include "core/clipboard/DataTransfer.h"
38 #include "core/css/StyleSheetContents.h" 38 #include "core/css/StyleSheetContents.h"
39 #include "core/css/resolver/StyleResolver.h" 39 #include "core/css/resolver/StyleResolver.h"
40 #include "core/css/resolver/ViewportStyleResolver.h" 40 #include "core/css/resolver/ViewportStyleResolver.h"
41 #include "core/dom/Document.h" 41 #include "core/dom/Document.h"
42 #include "core/dom/DocumentUserGestureToken.h"
42 #include "core/dom/Fullscreen.h" 43 #include "core/dom/Fullscreen.h"
43 #include "core/dom/NodeComputedStyle.h" 44 #include "core/dom/NodeComputedStyle.h"
44 #include "core/dom/Range.h" 45 #include "core/dom/Range.h"
45 #include "core/editing/Editor.h" 46 #include "core/editing/Editor.h"
46 #include "core/editing/EphemeralRange.h" 47 #include "core/editing/EphemeralRange.h"
47 #include "core/editing/FrameSelection.h" 48 #include "core/editing/FrameSelection.h"
48 #include "core/editing/VisiblePosition.h" 49 #include "core/editing/VisiblePosition.h"
49 #include "core/editing/markers/DocumentMarkerController.h" 50 #include "core/editing/markers/DocumentMarkerController.h"
50 #include "core/editing/spellcheck/SpellChecker.h" 51 #include "core/editing/spellcheck/SpellChecker.h"
51 #include "core/events/MouseEvent.h" 52 #include "core/events/MouseEvent.h"
(...skipping 6680 matching lines...) Expand 10 before | Expand all | Expand 10 after
6732 toLocalFrame(webViewHelper.webView()->page()->mainFrame())->document(); 6733 toLocalFrame(webViewHelper.webView()->page()->mainFrame())->document();
6733 KURL destination = toKURL(m_baseURL + "hello_world.html"); 6734 KURL destination = toKURL(m_baseURL + "hello_world.html");
6734 6735
6735 // ctrl+click event 6736 // ctrl+click event
6736 Event* event = MouseEvent::create( 6737 Event* event = MouseEvent::create(
6737 EventTypeNames::click, false, false, document->domWindow(), 0, 0, 0, 0, 0, 6738 EventTypeNames::click, false, false, document->domWindow(), 0, 0, 0, 0, 0,
6738 0, 0, PlatformEvent::CtrlKey, 0, 0, nullptr, 0, 6739 0, 0, PlatformEvent::CtrlKey, 0, 0, nullptr, 0,
6739 PlatformMouseEvent::RealOrIndistinguishable, String(), nullptr); 6740 PlatformMouseEvent::RealOrIndistinguishable, String(), nullptr);
6740 FrameLoadRequest frameRequest(document, ResourceRequest(destination)); 6741 FrameLoadRequest frameRequest(document, ResourceRequest(destination));
6741 frameRequest.setTriggeringEvent(event); 6742 frameRequest.setTriggeringEvent(event);
6742 UserGestureIndicator gesture(UserGestureToken::create()); 6743 UserGestureIndicator gesture(DocumentUserGestureToken::create(document));
6743 toLocalFrame(webViewHelper.webView()->page()->mainFrame()) 6744 toLocalFrame(webViewHelper.webView()->page()->mainFrame())
6744 ->loader() 6745 ->loader()
6745 .load(frameRequest); 6746 .load(frameRequest);
6746 FrameTestHelpers::pumpPendingRequestsForFrameToLoad( 6747 FrameTestHelpers::pumpPendingRequestsForFrameToLoad(
6747 webViewHelper.webView()->mainFrame()); 6748 webViewHelper.webView()->mainFrame());
6748 6749
6749 // decidePolicyForNavigation should be called both for the original request 6750 // decidePolicyForNavigation should be called both for the original request
6750 // and the ctrl+click. 6751 // and the ctrl+click.
6751 EXPECT_EQ(2, webFrameClient.decidePolicyCallCount()); 6752 EXPECT_EQ(2, webFrameClient.decidePolicyCallCount());
6752 } 6753 }
(...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after
7454 int viewportHeight = 480; 7455 int viewportHeight = 480;
7455 client.m_screenInfo.rect.width = viewportWidth; 7456 client.m_screenInfo.rect.width = viewportWidth;
7456 client.m_screenInfo.rect.height = viewportHeight; 7457 client.m_screenInfo.rect.height = viewportHeight;
7457 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad( 7458 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(
7458 m_baseURL + "fullscreen_div.html", true, nullptr, &client, nullptr, 7459 m_baseURL + "fullscreen_div.html", true, nullptr, &client, nullptr,
7459 configureAndroid); 7460 configureAndroid);
7460 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); 7461 webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
7461 webViewImpl->updateAllLifecyclePhases(); 7462 webViewImpl->updateAllLifecyclePhases();
7462 7463
7463 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); 7464 Document* document = webViewImpl->mainFrameImpl()->frame()->document();
7464 UserGestureIndicator gesture(UserGestureToken::create()); 7465 UserGestureIndicator gesture(DocumentUserGestureToken::create(document));
7465 Element* divFullscreen = document->getElementById("div1"); 7466 Element* divFullscreen = document->getElementById("div1");
7466 Fullscreen::requestFullscreen(*divFullscreen, Fullscreen::PrefixedRequest); 7467 Fullscreen::requestFullscreen(*divFullscreen, Fullscreen::PrefixedRequest);
7467 webViewImpl->didEnterFullscreen(); 7468 webViewImpl->didEnterFullscreen();
7468 webViewImpl->updateAllLifecyclePhases(); 7469 webViewImpl->updateAllLifecyclePhases();
7469 EXPECT_EQ(Fullscreen::currentFullScreenElementFrom(*document), divFullscreen); 7470 EXPECT_EQ(Fullscreen::currentFullScreenElementFrom(*document), divFullscreen);
7470 7471
7471 // Verify that the element is sized to the viewport. 7472 // Verify that the element is sized to the viewport.
7472 LayoutFullScreen* fullscreenLayoutObject = 7473 LayoutFullScreen* fullscreenLayoutObject =
7473 Fullscreen::from(*document).fullScreenLayoutObject(); 7474 Fullscreen::from(*document).fullScreenLayoutObject();
7474 EXPECT_EQ(viewportWidth, fullscreenLayoutObject->logicalWidth().toInt()); 7475 EXPECT_EQ(viewportWidth, fullscreenLayoutObject->logicalWidth().toInt());
(...skipping 14 matching lines...) Expand all
7489 FrameTestHelpers::WebViewHelper webViewHelper; 7490 FrameTestHelpers::WebViewHelper webViewHelper;
7490 int viewportWidth = 640; 7491 int viewportWidth = 640;
7491 int viewportHeight = 480; 7492 int viewportHeight = 480;
7492 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad( 7493 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(
7493 m_baseURL + "fullscreen_div.html", true, nullptr, &client, nullptr, 7494 m_baseURL + "fullscreen_div.html", true, nullptr, &client, nullptr,
7494 configureAndroid); 7495 configureAndroid);
7495 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); 7496 webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
7496 webViewImpl->updateAllLifecyclePhases(); 7497 webViewImpl->updateAllLifecyclePhases();
7497 7498
7498 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); 7499 Document* document = webViewImpl->mainFrameImpl()->frame()->document();
7499 UserGestureIndicator gesture(UserGestureToken::create()); 7500 UserGestureIndicator gesture(DocumentUserGestureToken::create(document));
7500 Element* divFullscreen = document->getElementById("div1"); 7501 Element* divFullscreen = document->getElementById("div1");
7501 Fullscreen::requestFullscreen(*divFullscreen, Fullscreen::PrefixedRequest); 7502 Fullscreen::requestFullscreen(*divFullscreen, Fullscreen::PrefixedRequest);
7502 webViewImpl->didEnterFullscreen(); 7503 webViewImpl->didEnterFullscreen();
7503 webViewImpl->updateAllLifecyclePhases(); 7504 webViewImpl->updateAllLifecyclePhases();
7504 7505
7505 // Verify that the viewports are nonscrollable. 7506 // Verify that the viewports are nonscrollable.
7506 EXPECT_EQ(Fullscreen::currentFullScreenElementFrom(*document), divFullscreen); 7507 EXPECT_EQ(Fullscreen::currentFullScreenElementFrom(*document), divFullscreen);
7507 FrameView* frameView = webViewHelper.webView()->mainFrameImpl()->frameView(); 7508 FrameView* frameView = webViewHelper.webView()->mainFrameImpl()->frameView();
7508 WebLayer* layoutViewportScrollLayer = 7509 WebLayer* layoutViewportScrollLayer =
7509 webViewImpl->compositor()->scrollLayer()->platformLayer(); 7510 webViewImpl->compositor()->scrollLayer()->platformLayer();
(...skipping 23 matching lines...) Expand all
7533 FrameTestHelpers::WebViewHelper webViewHelper; 7534 FrameTestHelpers::WebViewHelper webViewHelper;
7534 int viewportWidth = 640; 7535 int viewportWidth = 640;
7535 int viewportHeight = 480; 7536 int viewportHeight = 480;
7536 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad( 7537 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(
7537 m_baseURL + "fullscreen_div.html", true, nullptr, &client, nullptr, 7538 m_baseURL + "fullscreen_div.html", true, nullptr, &client, nullptr,
7538 configureAndroid); 7539 configureAndroid);
7539 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); 7540 webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
7540 webViewImpl->updateAllLifecyclePhases(); 7541 webViewImpl->updateAllLifecyclePhases();
7541 7542
7542 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); 7543 Document* document = webViewImpl->mainFrameImpl()->frame()->document();
7543 UserGestureIndicator gesture(UserGestureToken::create()); 7544 UserGestureIndicator gesture(DocumentUserGestureToken::create(document));
7544 Fullscreen::requestFullscreen(*document->documentElement(), 7545 Fullscreen::requestFullscreen(*document->documentElement(),
7545 Fullscreen::PrefixedRequest); 7546 Fullscreen::PrefixedRequest);
7546 webViewImpl->didEnterFullscreen(); 7547 webViewImpl->didEnterFullscreen();
7547 webViewImpl->updateAllLifecyclePhases(); 7548 webViewImpl->updateAllLifecyclePhases();
7548 7549
7549 // Verify that the main frame is still scrollable. 7550 // Verify that the main frame is still scrollable.
7550 EXPECT_EQ(Fullscreen::currentFullScreenElementFrom(*document), 7551 EXPECT_EQ(Fullscreen::currentFullScreenElementFrom(*document),
7551 document->documentElement()); 7552 document->documentElement());
7552 WebLayer* webScrollLayer = 7553 WebLayer* webScrollLayer =
7553 webViewImpl->compositor()->scrollLayer()->platformLayer(); 7554 webViewImpl->compositor()->scrollLayer()->platformLayer();
(...skipping 20 matching lines...) Expand all
7574 int viewportHeight = 480; 7575 int viewportHeight = 480;
7575 client.m_screenInfo.rect.width = viewportWidth; 7576 client.m_screenInfo.rect.width = viewportWidth;
7576 client.m_screenInfo.rect.height = viewportHeight; 7577 client.m_screenInfo.rect.height = viewportHeight;
7577 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); 7578 webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
7578 webViewImpl->updateAllLifecyclePhases(); 7579 webViewImpl->updateAllLifecyclePhases();
7579 7580
7580 Document* document = 7581 Document* document =
7581 toWebLocalFrameImpl(webViewHelper.webView()->mainFrame()->firstChild()) 7582 toWebLocalFrameImpl(webViewHelper.webView()->mainFrame()->firstChild())
7582 ->frame() 7583 ->frame()
7583 ->document(); 7584 ->document();
7584 UserGestureIndicator gesture(UserGestureToken::create()); 7585 UserGestureIndicator gesture(DocumentUserGestureToken::create(document));
7585 Element* divFullscreen = document->getElementById("div1"); 7586 Element* divFullscreen = document->getElementById("div1");
7586 Fullscreen::requestFullscreen(*divFullscreen, Fullscreen::PrefixedRequest); 7587 Fullscreen::requestFullscreen(*divFullscreen, Fullscreen::PrefixedRequest);
7587 webViewImpl->didEnterFullscreen(); 7588 webViewImpl->didEnterFullscreen();
7588 webViewImpl->updateAllLifecyclePhases(); 7589 webViewImpl->updateAllLifecyclePhases();
7589 7590
7590 // Verify that the element is sized to the viewport. 7591 // Verify that the element is sized to the viewport.
7591 LayoutFullScreen* fullscreenLayoutObject = 7592 LayoutFullScreen* fullscreenLayoutObject =
7592 Fullscreen::from(*document).fullScreenLayoutObject(); 7593 Fullscreen::from(*document).fullScreenLayoutObject();
7593 EXPECT_EQ(viewportWidth, fullscreenLayoutObject->logicalWidth().toInt()); 7594 EXPECT_EQ(viewportWidth, fullscreenLayoutObject->logicalWidth().toInt());
7594 EXPECT_EQ(viewportHeight, fullscreenLayoutObject->logicalHeight().toInt()); 7595 EXPECT_EQ(viewportHeight, fullscreenLayoutObject->logicalHeight().toInt());
(...skipping 23 matching lines...) Expand all
7618 7619
7619 LayoutViewItem layoutViewItem = 7620 LayoutViewItem layoutViewItem =
7620 webViewHelper.webView()->mainFrameImpl()->frameView()->layoutViewItem(); 7621 webViewHelper.webView()->mainFrameImpl()->frameView()->layoutViewItem();
7621 EXPECT_EQ(320, layoutViewItem.logicalWidth().floor()); 7622 EXPECT_EQ(320, layoutViewItem.logicalWidth().floor());
7622 EXPECT_EQ(533, layoutViewItem.logicalHeight().floor()); 7623 EXPECT_EQ(533, layoutViewItem.logicalHeight().floor());
7623 EXPECT_FLOAT_EQ(1.2, webViewImpl->pageScaleFactor()); 7624 EXPECT_FLOAT_EQ(1.2, webViewImpl->pageScaleFactor());
7624 EXPECT_FLOAT_EQ(1.2, webViewImpl->minimumPageScaleFactor()); 7625 EXPECT_FLOAT_EQ(1.2, webViewImpl->minimumPageScaleFactor());
7625 EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor()); 7626 EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor());
7626 7627
7627 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); 7628 Document* document = webViewImpl->mainFrameImpl()->frame()->document();
7628 UserGestureIndicator gesture(UserGestureToken::create()); 7629 UserGestureIndicator gesture(DocumentUserGestureToken::create(document));
7629 Fullscreen::requestFullscreen(*document->documentElement(), 7630 Fullscreen::requestFullscreen(*document->documentElement(),
7630 Fullscreen::PrefixedRequest); 7631 Fullscreen::PrefixedRequest);
7631 webViewImpl->didEnterFullscreen(); 7632 webViewImpl->didEnterFullscreen();
7632 webViewImpl->updateAllLifecyclePhases(); 7633 webViewImpl->updateAllLifecyclePhases();
7633 EXPECT_EQ(384, layoutViewItem.logicalWidth().floor()); 7634 EXPECT_EQ(384, layoutViewItem.logicalWidth().floor());
7634 EXPECT_EQ(640, layoutViewItem.logicalHeight().floor()); 7635 EXPECT_EQ(640, layoutViewItem.logicalHeight().floor());
7635 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor()); 7636 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor());
7636 EXPECT_FLOAT_EQ(1.0, webViewImpl->minimumPageScaleFactor()); 7637 EXPECT_FLOAT_EQ(1.0, webViewImpl->minimumPageScaleFactor());
7637 EXPECT_FLOAT_EQ(1.0, webViewImpl->maximumPageScaleFactor()); 7638 EXPECT_FLOAT_EQ(1.0, webViewImpl->maximumPageScaleFactor());
7638 7639
(...skipping 16 matching lines...) Expand all
7655 int viewportWidth = 384; 7656 int viewportWidth = 384;
7656 int viewportHeight = 640; 7657 int viewportHeight = 640;
7657 client.m_screenInfo.rect.width = viewportWidth; 7658 client.m_screenInfo.rect.width = viewportWidth;
7658 client.m_screenInfo.rect.height = viewportHeight; 7659 client.m_screenInfo.rect.height = viewportHeight;
7659 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); 7660 webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
7660 webViewImpl->updateAllLifecyclePhases(); 7661 webViewImpl->updateAllLifecyclePhases();
7661 7662
7662 LayoutViewItem layoutViewItem = 7663 LayoutViewItem layoutViewItem =
7663 webViewHelper.webView()->mainFrameImpl()->frameView()->layoutViewItem(); 7664 webViewHelper.webView()->mainFrameImpl()->frameView()->layoutViewItem();
7664 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); 7665 Document* document = webViewImpl->mainFrameImpl()->frame()->document();
7665 UserGestureIndicator gesture(UserGestureToken::create()); 7666 UserGestureIndicator gesture(DocumentUserGestureToken::create(document));
7666 Fullscreen::requestFullscreen(*document->documentElement(), 7667 Fullscreen::requestFullscreen(*document->documentElement(),
7667 Fullscreen::PrefixedRequest); 7668 Fullscreen::PrefixedRequest);
7668 webViewImpl->didEnterFullscreen(); 7669 webViewImpl->didEnterFullscreen();
7669 webViewImpl->updateAllLifecyclePhases(); 7670 webViewImpl->updateAllLifecyclePhases();
7670 EXPECT_EQ(384, layoutViewItem.logicalWidth().floor()); 7671 EXPECT_EQ(384, layoutViewItem.logicalWidth().floor());
7671 EXPECT_EQ(640, layoutViewItem.logicalHeight().floor()); 7672 EXPECT_EQ(640, layoutViewItem.logicalHeight().floor());
7672 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor()); 7673 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor());
7673 EXPECT_FLOAT_EQ(1.0, webViewImpl->minimumPageScaleFactor()); 7674 EXPECT_FLOAT_EQ(1.0, webViewImpl->minimumPageScaleFactor());
7674 EXPECT_FLOAT_EQ(1.0, webViewImpl->maximumPageScaleFactor()); 7675 EXPECT_FLOAT_EQ(1.0, webViewImpl->maximumPageScaleFactor());
7675 7676
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
7717 EXPECT_EQ(screenSizeMinusStatusBarsMinusUrlBar.width, 7718 EXPECT_EQ(screenSizeMinusStatusBarsMinusUrlBar.width,
7718 layoutViewItem.logicalWidth().floor()); 7719 layoutViewItem.logicalWidth().floor());
7719 EXPECT_EQ(screenSizeMinusStatusBarsMinusUrlBar.height, 7720 EXPECT_EQ(screenSizeMinusStatusBarsMinusUrlBar.height,
7720 layoutViewItem.logicalHeight().floor()); 7721 layoutViewItem.logicalHeight().floor());
7721 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor()); 7722 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor());
7722 EXPECT_FLOAT_EQ(1.0, webViewImpl->minimumPageScaleFactor()); 7723 EXPECT_FLOAT_EQ(1.0, webViewImpl->minimumPageScaleFactor());
7723 EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor()); 7724 EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor());
7724 7725
7725 { 7726 {
7726 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); 7727 Document* document = webViewImpl->mainFrameImpl()->frame()->document();
7727 UserGestureIndicator gesture(UserGestureToken::create()); 7728 UserGestureIndicator gesture(DocumentUserGestureToken::create(document));
7728 Fullscreen::requestFullscreen(*document->body(), 7729 Fullscreen::requestFullscreen(*document->body(),
7729 Fullscreen::PrefixedRequest); 7730 Fullscreen::PrefixedRequest);
7730 } 7731 }
7731 7732
7732 webViewImpl->didEnterFullscreen(); 7733 webViewImpl->didEnterFullscreen();
7733 webViewImpl->updateAllLifecyclePhases(); 7734 webViewImpl->updateAllLifecyclePhases();
7734 client.m_screenInfo.rect.width = screenSizeMinusStatusBars.width; 7735 client.m_screenInfo.rect.width = screenSizeMinusStatusBars.width;
7735 client.m_screenInfo.rect.height = screenSizeMinusStatusBars.height; 7736 client.m_screenInfo.rect.height = screenSizeMinusStatusBars.height;
7736 webViewHelper.resize(screenSizeMinusStatusBars); 7737 webViewHelper.resize(screenSizeMinusStatusBars);
7737 client.m_screenInfo.rect.width = screenSize.width; 7738 client.m_screenInfo.rect.width = screenSize.width;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
7779 LayoutViewItem layoutViewItem = 7780 LayoutViewItem layoutViewItem =
7780 webViewImpl->mainFrameImpl()->frameView()->layoutViewItem(); 7781 webViewImpl->mainFrameImpl()->frameView()->layoutViewItem();
7781 EXPECT_EQ(320, layoutViewItem.logicalWidth().floor()); 7782 EXPECT_EQ(320, layoutViewItem.logicalWidth().floor());
7782 EXPECT_EQ(640, layoutViewItem.logicalHeight().floor()); 7783 EXPECT_EQ(640, layoutViewItem.logicalHeight().floor());
7783 EXPECT_FLOAT_EQ(0.3125, webViewImpl->pageScaleFactor()); 7784 EXPECT_FLOAT_EQ(0.3125, webViewImpl->pageScaleFactor());
7784 EXPECT_FLOAT_EQ(0.3125, webViewImpl->minimumPageScaleFactor()); 7785 EXPECT_FLOAT_EQ(0.3125, webViewImpl->minimumPageScaleFactor());
7785 EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor()); 7786 EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor());
7786 7787
7787 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); 7788 Document* document = webViewImpl->mainFrameImpl()->frame()->document();
7788 UserGestureIndicator gesture( 7789 UserGestureIndicator gesture(
7789 UserGestureToken::create(UserGestureToken::NewGesture)); 7790 DocumentUserGestureToken::create(document, UserGestureToken::NewGesture));
7790 Fullscreen::requestFullscreen(*document->documentElement(), 7791 Fullscreen::requestFullscreen(*document->documentElement(),
7791 Fullscreen::PrefixedRequest); 7792 Fullscreen::PrefixedRequest);
7792 webViewImpl->didEnterFullscreen(); 7793 webViewImpl->didEnterFullscreen();
7793 webViewImpl->updateAllLifecyclePhases(); 7794 webViewImpl->updateAllLifecyclePhases();
7794 7795
7795 // Entering fullscreen causes layout size and page scale limits to be 7796 // Entering fullscreen causes layout size and page scale limits to be
7796 // overridden. 7797 // overridden.
7797 EXPECT_EQ(100, layoutViewItem.logicalWidth().floor()); 7798 EXPECT_EQ(100, layoutViewItem.logicalWidth().floor());
7798 EXPECT_EQ(200, layoutViewItem.logicalHeight().floor()); 7799 EXPECT_EQ(200, layoutViewItem.logicalHeight().floor());
7799 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor()); 7800 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor());
(...skipping 2460 matching lines...) Expand 10 before | Expand all | Expand 10 after
10260 webViewHelper.webView()->handleInputEvent(endEvent); 10261 webViewHelper.webView()->handleInputEvent(endEvent);
10261 webViewHelper.webView()->handleInputEvent(updateEvent); 10262 webViewHelper.webView()->handleInputEvent(updateEvent);
10262 10263
10263 // Try a full Begin/Update/End cycle. 10264 // Try a full Begin/Update/End cycle.
10264 webViewHelper.webView()->handleInputEvent(beginEvent); 10265 webViewHelper.webView()->handleInputEvent(beginEvent);
10265 webViewHelper.webView()->handleInputEvent(updateEvent); 10266 webViewHelper.webView()->handleInputEvent(updateEvent);
10266 webViewHelper.webView()->handleInputEvent(endEvent); 10267 webViewHelper.webView()->handleInputEvent(endEvent);
10267 } 10268 }
10268 10269
10269 } // namespace blink 10270 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebViewImpl.cpp ('k') | third_party/WebKit/Source/web/tests/WebUserGestureTokenTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698