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

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: Address comments Created 4 years, 2 months 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 6627 matching lines...) Expand 10 before | Expand all | Expand 10 after
6679 toLocalFrame(webViewHelper.webView()->page()->mainFrame())->document(); 6680 toLocalFrame(webViewHelper.webView()->page()->mainFrame())->document();
6680 KURL destination = toKURL(m_baseURL + "hello_world.html"); 6681 KURL destination = toKURL(m_baseURL + "hello_world.html");
6681 6682
6682 // ctrl+click event 6683 // ctrl+click event
6683 Event* event = MouseEvent::create( 6684 Event* event = MouseEvent::create(
6684 EventTypeNames::click, false, false, document->domWindow(), 0, 0, 0, 0, 0, 6685 EventTypeNames::click, false, false, document->domWindow(), 0, 0, 0, 0, 0,
6685 0, 0, PlatformEvent::CtrlKey, 0, 0, nullptr, 0, 6686 0, 0, PlatformEvent::CtrlKey, 0, 0, nullptr, 0,
6686 PlatformMouseEvent::RealOrIndistinguishable, String(), nullptr); 6687 PlatformMouseEvent::RealOrIndistinguishable, String(), nullptr);
6687 FrameLoadRequest frameRequest(document, ResourceRequest(destination)); 6688 FrameLoadRequest frameRequest(document, ResourceRequest(destination));
6688 frameRequest.setTriggeringEvent(event); 6689 frameRequest.setTriggeringEvent(event);
6689 UserGestureIndicator gesture(UserGestureToken::create()); 6690 UserGestureIndicator gesture(DocumentUserGestureToken::create(document));
6690 toLocalFrame(webViewHelper.webView()->page()->mainFrame()) 6691 toLocalFrame(webViewHelper.webView()->page()->mainFrame())
6691 ->loader() 6692 ->loader()
6692 .load(frameRequest); 6693 .load(frameRequest);
6693 FrameTestHelpers::pumpPendingRequestsForFrameToLoad( 6694 FrameTestHelpers::pumpPendingRequestsForFrameToLoad(
6694 webViewHelper.webView()->mainFrame()); 6695 webViewHelper.webView()->mainFrame());
6695 6696
6696 // decidePolicyForNavigation should be called both for the original request 6697 // decidePolicyForNavigation should be called both for the original request
6697 // and the ctrl+click. 6698 // and the ctrl+click.
6698 EXPECT_EQ(2, webFrameClient.decidePolicyCallCount()); 6699 EXPECT_EQ(2, webFrameClient.decidePolicyCallCount());
6699 } 6700 }
(...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after
7401 int viewportHeight = 480; 7402 int viewportHeight = 480;
7402 client.m_screenInfo.rect.width = viewportWidth; 7403 client.m_screenInfo.rect.width = viewportWidth;
7403 client.m_screenInfo.rect.height = viewportHeight; 7404 client.m_screenInfo.rect.height = viewportHeight;
7404 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad( 7405 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(
7405 m_baseURL + "fullscreen_div.html", true, nullptr, &client, nullptr, 7406 m_baseURL + "fullscreen_div.html", true, nullptr, &client, nullptr,
7406 configureAndroid); 7407 configureAndroid);
7407 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); 7408 webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
7408 webViewImpl->updateAllLifecyclePhases(); 7409 webViewImpl->updateAllLifecyclePhases();
7409 7410
7410 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); 7411 Document* document = webViewImpl->mainFrameImpl()->frame()->document();
7411 UserGestureIndicator gesture(UserGestureToken::create()); 7412 UserGestureIndicator gesture(DocumentUserGestureToken::create(document));
7412 Element* divFullscreen = document->getElementById("div1"); 7413 Element* divFullscreen = document->getElementById("div1");
7413 Fullscreen::requestFullscreen(*divFullscreen, Fullscreen::PrefixedRequest); 7414 Fullscreen::requestFullscreen(*divFullscreen, Fullscreen::PrefixedRequest);
7414 webViewImpl->didEnterFullscreen(); 7415 webViewImpl->didEnterFullscreen();
7415 webViewImpl->updateAllLifecyclePhases(); 7416 webViewImpl->updateAllLifecyclePhases();
7416 EXPECT_EQ(Fullscreen::currentFullScreenElementFrom(*document), divFullscreen); 7417 EXPECT_EQ(Fullscreen::currentFullScreenElementFrom(*document), divFullscreen);
7417 7418
7418 // Verify that the element is sized to the viewport. 7419 // Verify that the element is sized to the viewport.
7419 LayoutFullScreen* fullscreenLayoutObject = 7420 LayoutFullScreen* fullscreenLayoutObject =
7420 Fullscreen::from(*document).fullScreenLayoutObject(); 7421 Fullscreen::from(*document).fullScreenLayoutObject();
7421 EXPECT_EQ(viewportWidth, fullscreenLayoutObject->logicalWidth().toInt()); 7422 EXPECT_EQ(viewportWidth, fullscreenLayoutObject->logicalWidth().toInt());
(...skipping 14 matching lines...) Expand all
7436 FrameTestHelpers::WebViewHelper webViewHelper; 7437 FrameTestHelpers::WebViewHelper webViewHelper;
7437 int viewportWidth = 640; 7438 int viewportWidth = 640;
7438 int viewportHeight = 480; 7439 int viewportHeight = 480;
7439 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad( 7440 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(
7440 m_baseURL + "fullscreen_div.html", true, nullptr, &client, nullptr, 7441 m_baseURL + "fullscreen_div.html", true, nullptr, &client, nullptr,
7441 configureAndroid); 7442 configureAndroid);
7442 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); 7443 webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
7443 webViewImpl->updateAllLifecyclePhases(); 7444 webViewImpl->updateAllLifecyclePhases();
7444 7445
7445 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); 7446 Document* document = webViewImpl->mainFrameImpl()->frame()->document();
7446 UserGestureIndicator gesture(UserGestureToken::create()); 7447 UserGestureIndicator gesture(DocumentUserGestureToken::create(document));
7447 Element* divFullscreen = document->getElementById("div1"); 7448 Element* divFullscreen = document->getElementById("div1");
7448 Fullscreen::requestFullscreen(*divFullscreen, Fullscreen::PrefixedRequest); 7449 Fullscreen::requestFullscreen(*divFullscreen, Fullscreen::PrefixedRequest);
7449 webViewImpl->didEnterFullscreen(); 7450 webViewImpl->didEnterFullscreen();
7450 webViewImpl->updateAllLifecyclePhases(); 7451 webViewImpl->updateAllLifecyclePhases();
7451 7452
7452 // Verify that the viewports are nonscrollable. 7453 // Verify that the viewports are nonscrollable.
7453 EXPECT_EQ(Fullscreen::currentFullScreenElementFrom(*document), divFullscreen); 7454 EXPECT_EQ(Fullscreen::currentFullScreenElementFrom(*document), divFullscreen);
7454 FrameView* frameView = webViewHelper.webView()->mainFrameImpl()->frameView(); 7455 FrameView* frameView = webViewHelper.webView()->mainFrameImpl()->frameView();
7455 WebLayer* layoutViewportScrollLayer = 7456 WebLayer* layoutViewportScrollLayer =
7456 webViewImpl->compositor()->scrollLayer()->platformLayer(); 7457 webViewImpl->compositor()->scrollLayer()->platformLayer();
(...skipping 23 matching lines...) Expand all
7480 FrameTestHelpers::WebViewHelper webViewHelper; 7481 FrameTestHelpers::WebViewHelper webViewHelper;
7481 int viewportWidth = 640; 7482 int viewportWidth = 640;
7482 int viewportHeight = 480; 7483 int viewportHeight = 480;
7483 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad( 7484 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(
7484 m_baseURL + "fullscreen_div.html", true, nullptr, &client, nullptr, 7485 m_baseURL + "fullscreen_div.html", true, nullptr, &client, nullptr,
7485 configureAndroid); 7486 configureAndroid);
7486 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); 7487 webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
7487 webViewImpl->updateAllLifecyclePhases(); 7488 webViewImpl->updateAllLifecyclePhases();
7488 7489
7489 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); 7490 Document* document = webViewImpl->mainFrameImpl()->frame()->document();
7490 UserGestureIndicator gesture(UserGestureToken::create()); 7491 UserGestureIndicator gesture(DocumentUserGestureToken::create(document));
7491 Fullscreen::requestFullscreen(*document->documentElement(), 7492 Fullscreen::requestFullscreen(*document->documentElement(),
7492 Fullscreen::PrefixedRequest); 7493 Fullscreen::PrefixedRequest);
7493 webViewImpl->didEnterFullscreen(); 7494 webViewImpl->didEnterFullscreen();
7494 webViewImpl->updateAllLifecyclePhases(); 7495 webViewImpl->updateAllLifecyclePhases();
7495 7496
7496 // Verify that the main frame is still scrollable. 7497 // Verify that the main frame is still scrollable.
7497 EXPECT_EQ(Fullscreen::currentFullScreenElementFrom(*document), 7498 EXPECT_EQ(Fullscreen::currentFullScreenElementFrom(*document),
7498 document->documentElement()); 7499 document->documentElement());
7499 WebLayer* webScrollLayer = 7500 WebLayer* webScrollLayer =
7500 webViewImpl->compositor()->scrollLayer()->platformLayer(); 7501 webViewImpl->compositor()->scrollLayer()->platformLayer();
(...skipping 20 matching lines...) Expand all
7521 int viewportHeight = 480; 7522 int viewportHeight = 480;
7522 client.m_screenInfo.rect.width = viewportWidth; 7523 client.m_screenInfo.rect.width = viewportWidth;
7523 client.m_screenInfo.rect.height = viewportHeight; 7524 client.m_screenInfo.rect.height = viewportHeight;
7524 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); 7525 webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
7525 webViewImpl->updateAllLifecyclePhases(); 7526 webViewImpl->updateAllLifecyclePhases();
7526 7527
7527 Document* document = 7528 Document* document =
7528 toWebLocalFrameImpl(webViewHelper.webView()->mainFrame()->firstChild()) 7529 toWebLocalFrameImpl(webViewHelper.webView()->mainFrame()->firstChild())
7529 ->frame() 7530 ->frame()
7530 ->document(); 7531 ->document();
7531 UserGestureIndicator gesture(UserGestureToken::create()); 7532 UserGestureIndicator gesture(DocumentUserGestureToken::create(document));
7532 Element* divFullscreen = document->getElementById("div1"); 7533 Element* divFullscreen = document->getElementById("div1");
7533 Fullscreen::requestFullscreen(*divFullscreen, Fullscreen::PrefixedRequest); 7534 Fullscreen::requestFullscreen(*divFullscreen, Fullscreen::PrefixedRequest);
7534 webViewImpl->didEnterFullscreen(); 7535 webViewImpl->didEnterFullscreen();
7535 webViewImpl->updateAllLifecyclePhases(); 7536 webViewImpl->updateAllLifecyclePhases();
7536 7537
7537 // Verify that the element is sized to the viewport. 7538 // Verify that the element is sized to the viewport.
7538 LayoutFullScreen* fullscreenLayoutObject = 7539 LayoutFullScreen* fullscreenLayoutObject =
7539 Fullscreen::from(*document).fullScreenLayoutObject(); 7540 Fullscreen::from(*document).fullScreenLayoutObject();
7540 EXPECT_EQ(viewportWidth, fullscreenLayoutObject->logicalWidth().toInt()); 7541 EXPECT_EQ(viewportWidth, fullscreenLayoutObject->logicalWidth().toInt());
7541 EXPECT_EQ(viewportHeight, fullscreenLayoutObject->logicalHeight().toInt()); 7542 EXPECT_EQ(viewportHeight, fullscreenLayoutObject->logicalHeight().toInt());
(...skipping 23 matching lines...) Expand all
7565 7566
7566 LayoutViewItem layoutViewItem = 7567 LayoutViewItem layoutViewItem =
7567 webViewHelper.webView()->mainFrameImpl()->frameView()->layoutViewItem(); 7568 webViewHelper.webView()->mainFrameImpl()->frameView()->layoutViewItem();
7568 EXPECT_EQ(320, layoutViewItem.logicalWidth().floor()); 7569 EXPECT_EQ(320, layoutViewItem.logicalWidth().floor());
7569 EXPECT_EQ(533, layoutViewItem.logicalHeight().floor()); 7570 EXPECT_EQ(533, layoutViewItem.logicalHeight().floor());
7570 EXPECT_FLOAT_EQ(1.2, webViewImpl->pageScaleFactor()); 7571 EXPECT_FLOAT_EQ(1.2, webViewImpl->pageScaleFactor());
7571 EXPECT_FLOAT_EQ(1.2, webViewImpl->minimumPageScaleFactor()); 7572 EXPECT_FLOAT_EQ(1.2, webViewImpl->minimumPageScaleFactor());
7572 EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor()); 7573 EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor());
7573 7574
7574 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); 7575 Document* document = webViewImpl->mainFrameImpl()->frame()->document();
7575 UserGestureIndicator gesture(UserGestureToken::create()); 7576 UserGestureIndicator gesture(DocumentUserGestureToken::create(document));
7576 Fullscreen::requestFullscreen(*document->documentElement(), 7577 Fullscreen::requestFullscreen(*document->documentElement(),
7577 Fullscreen::PrefixedRequest); 7578 Fullscreen::PrefixedRequest);
7578 webViewImpl->didEnterFullscreen(); 7579 webViewImpl->didEnterFullscreen();
7579 webViewImpl->updateAllLifecyclePhases(); 7580 webViewImpl->updateAllLifecyclePhases();
7580 EXPECT_EQ(384, layoutViewItem.logicalWidth().floor()); 7581 EXPECT_EQ(384, layoutViewItem.logicalWidth().floor());
7581 EXPECT_EQ(640, layoutViewItem.logicalHeight().floor()); 7582 EXPECT_EQ(640, layoutViewItem.logicalHeight().floor());
7582 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor()); 7583 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor());
7583 EXPECT_FLOAT_EQ(1.0, webViewImpl->minimumPageScaleFactor()); 7584 EXPECT_FLOAT_EQ(1.0, webViewImpl->minimumPageScaleFactor());
7584 EXPECT_FLOAT_EQ(1.0, webViewImpl->maximumPageScaleFactor()); 7585 EXPECT_FLOAT_EQ(1.0, webViewImpl->maximumPageScaleFactor());
7585 7586
(...skipping 16 matching lines...) Expand all
7602 int viewportWidth = 384; 7603 int viewportWidth = 384;
7603 int viewportHeight = 640; 7604 int viewportHeight = 640;
7604 client.m_screenInfo.rect.width = viewportWidth; 7605 client.m_screenInfo.rect.width = viewportWidth;
7605 client.m_screenInfo.rect.height = viewportHeight; 7606 client.m_screenInfo.rect.height = viewportHeight;
7606 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); 7607 webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
7607 webViewImpl->updateAllLifecyclePhases(); 7608 webViewImpl->updateAllLifecyclePhases();
7608 7609
7609 LayoutViewItem layoutViewItem = 7610 LayoutViewItem layoutViewItem =
7610 webViewHelper.webView()->mainFrameImpl()->frameView()->layoutViewItem(); 7611 webViewHelper.webView()->mainFrameImpl()->frameView()->layoutViewItem();
7611 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); 7612 Document* document = webViewImpl->mainFrameImpl()->frame()->document();
7612 UserGestureIndicator gesture(UserGestureToken::create()); 7613 UserGestureIndicator gesture(DocumentUserGestureToken::create(document));
7613 Fullscreen::requestFullscreen(*document->documentElement(), 7614 Fullscreen::requestFullscreen(*document->documentElement(),
7614 Fullscreen::PrefixedRequest); 7615 Fullscreen::PrefixedRequest);
7615 webViewImpl->didEnterFullscreen(); 7616 webViewImpl->didEnterFullscreen();
7616 webViewImpl->updateAllLifecyclePhases(); 7617 webViewImpl->updateAllLifecyclePhases();
7617 EXPECT_EQ(384, layoutViewItem.logicalWidth().floor()); 7618 EXPECT_EQ(384, layoutViewItem.logicalWidth().floor());
7618 EXPECT_EQ(640, layoutViewItem.logicalHeight().floor()); 7619 EXPECT_EQ(640, layoutViewItem.logicalHeight().floor());
7619 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor()); 7620 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor());
7620 EXPECT_FLOAT_EQ(1.0, webViewImpl->minimumPageScaleFactor()); 7621 EXPECT_FLOAT_EQ(1.0, webViewImpl->minimumPageScaleFactor());
7621 EXPECT_FLOAT_EQ(1.0, webViewImpl->maximumPageScaleFactor()); 7622 EXPECT_FLOAT_EQ(1.0, webViewImpl->maximumPageScaleFactor());
7622 7623
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
7664 EXPECT_EQ(screenSizeMinusStatusBarsMinusUrlBar.width, 7665 EXPECT_EQ(screenSizeMinusStatusBarsMinusUrlBar.width,
7665 layoutViewItem.logicalWidth().floor()); 7666 layoutViewItem.logicalWidth().floor());
7666 EXPECT_EQ(screenSizeMinusStatusBarsMinusUrlBar.height, 7667 EXPECT_EQ(screenSizeMinusStatusBarsMinusUrlBar.height,
7667 layoutViewItem.logicalHeight().floor()); 7668 layoutViewItem.logicalHeight().floor());
7668 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor()); 7669 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor());
7669 EXPECT_FLOAT_EQ(1.0, webViewImpl->minimumPageScaleFactor()); 7670 EXPECT_FLOAT_EQ(1.0, webViewImpl->minimumPageScaleFactor());
7670 EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor()); 7671 EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor());
7671 7672
7672 { 7673 {
7673 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); 7674 Document* document = webViewImpl->mainFrameImpl()->frame()->document();
7674 UserGestureIndicator gesture(UserGestureToken::create()); 7675 UserGestureIndicator gesture(DocumentUserGestureToken::create(document));
7675 Fullscreen::requestFullscreen(*document->body(), 7676 Fullscreen::requestFullscreen(*document->body(),
7676 Fullscreen::PrefixedRequest); 7677 Fullscreen::PrefixedRequest);
7677 } 7678 }
7678 7679
7679 webViewImpl->didEnterFullscreen(); 7680 webViewImpl->didEnterFullscreen();
7680 webViewImpl->updateAllLifecyclePhases(); 7681 webViewImpl->updateAllLifecyclePhases();
7681 client.m_screenInfo.rect.width = screenSizeMinusStatusBars.width; 7682 client.m_screenInfo.rect.width = screenSizeMinusStatusBars.width;
7682 client.m_screenInfo.rect.height = screenSizeMinusStatusBars.height; 7683 client.m_screenInfo.rect.height = screenSizeMinusStatusBars.height;
7683 webViewHelper.resize(screenSizeMinusStatusBars); 7684 webViewHelper.resize(screenSizeMinusStatusBars);
7684 client.m_screenInfo.rect.width = screenSize.width; 7685 client.m_screenInfo.rect.width = screenSize.width;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
7726 LayoutViewItem layoutViewItem = 7727 LayoutViewItem layoutViewItem =
7727 webViewImpl->mainFrameImpl()->frameView()->layoutViewItem(); 7728 webViewImpl->mainFrameImpl()->frameView()->layoutViewItem();
7728 EXPECT_EQ(320, layoutViewItem.logicalWidth().floor()); 7729 EXPECT_EQ(320, layoutViewItem.logicalWidth().floor());
7729 EXPECT_EQ(640, layoutViewItem.logicalHeight().floor()); 7730 EXPECT_EQ(640, layoutViewItem.logicalHeight().floor());
7730 EXPECT_FLOAT_EQ(0.3125, webViewImpl->pageScaleFactor()); 7731 EXPECT_FLOAT_EQ(0.3125, webViewImpl->pageScaleFactor());
7731 EXPECT_FLOAT_EQ(0.3125, webViewImpl->minimumPageScaleFactor()); 7732 EXPECT_FLOAT_EQ(0.3125, webViewImpl->minimumPageScaleFactor());
7732 EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor()); 7733 EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor());
7733 7734
7734 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); 7735 Document* document = webViewImpl->mainFrameImpl()->frame()->document();
7735 UserGestureIndicator gesture( 7736 UserGestureIndicator gesture(
7736 UserGestureToken::create(UserGestureToken::NewGesture)); 7737 DocumentUserGestureToken::create(document, UserGestureToken::NewGesture));
7737 Fullscreen::requestFullscreen(*document->documentElement(), 7738 Fullscreen::requestFullscreen(*document->documentElement(),
7738 Fullscreen::PrefixedRequest); 7739 Fullscreen::PrefixedRequest);
7739 webViewImpl->didEnterFullscreen(); 7740 webViewImpl->didEnterFullscreen();
7740 webViewImpl->updateAllLifecyclePhases(); 7741 webViewImpl->updateAllLifecyclePhases();
7741 7742
7742 // Entering fullscreen causes layout size and page scale limits to be 7743 // Entering fullscreen causes layout size and page scale limits to be
7743 // overridden. 7744 // overridden.
7744 EXPECT_EQ(100, layoutViewItem.logicalWidth().floor()); 7745 EXPECT_EQ(100, layoutViewItem.logicalWidth().floor());
7745 EXPECT_EQ(200, layoutViewItem.logicalHeight().floor()); 7746 EXPECT_EQ(200, layoutViewItem.logicalHeight().floor());
7746 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor()); 7747 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor());
(...skipping 2460 matching lines...) Expand 10 before | Expand all | Expand 10 after
10207 webViewHelper.webView()->handleInputEvent(endEvent); 10208 webViewHelper.webView()->handleInputEvent(endEvent);
10208 webViewHelper.webView()->handleInputEvent(updateEvent); 10209 webViewHelper.webView()->handleInputEvent(updateEvent);
10209 10210
10210 // Try a full Begin/Update/End cycle. 10211 // Try a full Begin/Update/End cycle.
10211 webViewHelper.webView()->handleInputEvent(beginEvent); 10212 webViewHelper.webView()->handleInputEvent(beginEvent);
10212 webViewHelper.webView()->handleInputEvent(updateEvent); 10213 webViewHelper.webView()->handleInputEvent(updateEvent);
10213 webViewHelper.webView()->handleInputEvent(endEvent); 10214 webViewHelper.webView()->handleInputEvent(endEvent);
10214 } 10215 }
10215 10216
10216 } // namespace blink 10217 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698