| OLD | NEW |
| 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 8321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8332 } | 8332 } |
| 8333 | 8333 |
| 8334 TEST_P(WebFrameOverscrollTest, ReportingLatestOverscrollForElasticOverscroll) | 8334 TEST_P(WebFrameOverscrollTest, ReportingLatestOverscrollForElasticOverscroll) |
| 8335 { | 8335 { |
| 8336 OverscrollWebViewClient client; | 8336 OverscrollWebViewClient client; |
| 8337 registerMockedHttpURLLoad("overscroll/overscroll.html"); | 8337 registerMockedHttpURLLoad("overscroll/overscroll.html"); |
| 8338 FrameTestHelpers::WebViewHelper webViewHelper; | 8338 FrameTestHelpers::WebViewHelper webViewHelper; |
| 8339 webViewHelper.initializeAndLoad(m_baseURL + "overscroll/overscroll.html", tr
ue, 0, &client, configureAndroid); | 8339 webViewHelper.initializeAndLoad(m_baseURL + "overscroll/overscroll.html", tr
ue, 0, &client, configureAndroid); |
| 8340 webViewHelper.resize(WebSize(200, 200)); | 8340 webViewHelper.resize(WebSize(200, 200)); |
| 8341 | 8341 |
| 8342 // On disabling ReportWheelOverscroll, overscroll is not reported on MouseWh
eel. | |
| 8343 webViewHelper.webView()->settings()->setReportWheelOverscroll(false); | |
| 8344 EXPECT_CALL(client, didOverscroll(_, _, _, _)).Times(0); | |
| 8345 ScrollByWheel(&webViewHelper, 10, 10, 1000, 1000); | |
| 8346 Mock::VerifyAndClearExpectations(&client); | |
| 8347 | |
| 8348 // On enabling ReportWheelOverscroll, overscroll is reported on MouseWheel. | |
| 8349 webViewHelper.webView()->settings()->setReportWheelOverscroll(true); | |
| 8350 EXPECT_CALL(client, didOverscroll(WebFloatSize(-1000, -1000), WebFloatSize(-
1000, -1000), WebFloatPoint(), WebFloatSize())); | 8342 EXPECT_CALL(client, didOverscroll(WebFloatSize(-1000, -1000), WebFloatSize(-
1000, -1000), WebFloatPoint(), WebFloatSize())); |
| 8351 ScrollByWheel(&webViewHelper, 10, 10, 1000, 1000); | 8343 ScrollByWheel(&webViewHelper, 10, 10, 1000, 1000); |
| 8352 Mock::VerifyAndClearExpectations(&client); | 8344 Mock::VerifyAndClearExpectations(&client); |
| 8353 } | 8345 } |
| 8354 | 8346 |
| 8355 TEST_F(WebFrameTest, OrientationFrameDetach) | 8347 TEST_F(WebFrameTest, OrientationFrameDetach) |
| 8356 { | 8348 { |
| 8357 RuntimeEnabledFeatures::setOrientationEventEnabled(true); | 8349 RuntimeEnabledFeatures::setOrientationEventEnabled(true); |
| 8358 registerMockedHttpURLLoad("orientation-frame-detach.html"); | 8350 registerMockedHttpURLLoad("orientation-frame-detach.html"); |
| 8359 FrameTestHelpers::WebViewHelper webViewHelper; | 8351 FrameTestHelpers::WebViewHelper webViewHelper; |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8569 WebLocalFrame* mainFrame = helper.webView()->mainFrame()->toWebLocalFrame(); | 8561 WebLocalFrame* mainFrame = helper.webView()->mainFrame()->toWebLocalFrame(); |
| 8570 v8::HandleScope scope(v8::Isolate::GetCurrent()); | 8562 v8::HandleScope scope(v8::Isolate::GetCurrent()); |
| 8571 mainFrame->executeScript(WebScriptSource("hello = 'world';")); | 8563 mainFrame->executeScript(WebScriptSource("hello = 'world';")); |
| 8572 FrameTestHelpers::loadFrame(mainFrame, "data:text/html,new page"); | 8564 FrameTestHelpers::loadFrame(mainFrame, "data:text/html,new page"); |
| 8573 v8::Local<v8::Value> result = mainFrame->executeScriptAndReturnValue(WebScri
ptSource("hello")); | 8565 v8::Local<v8::Value> result = mainFrame->executeScriptAndReturnValue(WebScri
ptSource("hello")); |
| 8574 ASSERT_TRUE(result->IsString()); | 8566 ASSERT_TRUE(result->IsString()); |
| 8575 EXPECT_EQ("world", toCoreString(result->ToString(mainFrame->mainWorldScriptC
ontext()).ToLocalChecked())); | 8567 EXPECT_EQ("world", toCoreString(result->ToString(mainFrame->mainWorldScriptC
ontext()).ToLocalChecked())); |
| 8576 } | 8568 } |
| 8577 | 8569 |
| 8578 } // namespace blink | 8570 } // namespace blink |
| OLD | NEW |