OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * Copyright (C) 2010 Pawel Hajdan (phajdan.jr@chromium.org) | 3 * Copyright (C) 2010 Pawel Hajdan (phajdan.jr@chromium.org) |
4 * Copyright (C) 2012 Apple Inc. All Rights Reserved. | 4 * Copyright (C) 2012 Apple Inc. All Rights Reserved. |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions are | 7 * modification, are permitted provided that the following conditions are |
8 * met: | 8 * met: |
9 * | 9 * |
10 * * Redistributions of source code must retain the above copyright | 10 * * Redistributions of source code must retain the above copyright |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 { | 352 { |
353 if (m_webView) { | 353 if (m_webView) { |
354 m_webView->setZoomLevel(false, 0); | 354 m_webView->setZoomLevel(false, 0); |
355 m_webView->setTabKeyCyclesThroughElements(true); | 355 m_webView->setTabKeyCyclesThroughElements(true); |
356 #if !defined(__APPLE__) && !defined(WIN32) // Actually, TOOLKIT_GTK | 356 #if !defined(__APPLE__) && !defined(WIN32) // Actually, TOOLKIT_GTK |
357 // (Constants copied because we can't depend on the header that defined | 357 // (Constants copied because we can't depend on the header that defined |
358 // them from this file.) | 358 // them from this file.) |
359 m_webView->setSelectionColors(0xff1e90ff, 0xff000000, 0xffc8c8c8, 0xff32
3232); | 359 m_webView->setSelectionColors(0xff1e90ff, 0xff000000, 0xffc8c8c8, 0xff32
3232); |
360 #endif | 360 #endif |
361 m_webView->removeAllUserContent(); | 361 m_webView->removeAllUserContent(); |
362 m_webView->disableAutoResizeMode(); | |
363 } | 362 } |
364 m_topLoadingFrame = 0; | 363 m_topLoadingFrame = 0; |
365 m_waitUntilDone = false; | 364 m_waitUntilDone = false; |
366 m_policyDelegateEnabled = false; | 365 m_policyDelegateEnabled = false; |
367 m_policyDelegateIsPermissive = false; | 366 m_policyDelegateIsPermissive = false; |
368 m_policyDelegateShouldNotifyDone = false; | 367 m_policyDelegateShouldNotifyDone = false; |
369 | 368 |
370 WebSecurityPolicy::resetOriginAccessWhitelists(); | 369 WebSecurityPolicy::resetOriginAccessWhitelists(); |
371 #if defined(__linux__) || defined(ANDROID) | 370 #if defined(__linux__) || defined(ANDROID) |
372 WebFontRendering::setSubpixelPositioning(false); | 371 WebFontRendering::setSubpixelPositioning(false); |
373 #endif | 372 #endif |
374 | 373 |
375 if (m_delegate) { | 374 if (m_delegate) { |
376 // Reset the default quota for each origin to 5MB | 375 // Reset the default quota for each origin to 5MB |
377 m_delegate->setDatabaseQuota(5 * 1024 * 1024); | 376 m_delegate->setDatabaseQuota(5 * 1024 * 1024); |
378 m_delegate->setDeviceScaleFactor(1); | 377 m_delegate->setDeviceScaleFactor(1); |
379 m_delegate->setAcceptAllCookies(false); | 378 m_delegate->setAcceptAllCookies(false); |
380 m_delegate->setLocale(""); | 379 m_delegate->setLocale(""); |
| 380 if (m_webView) |
| 381 m_delegate->disableAutoResizeMode(m_webView->size()); |
381 } | 382 } |
382 | 383 |
383 m_dumpEditingCallbacks = false; | 384 m_dumpEditingCallbacks = false; |
384 m_dumpAsText = false; | 385 m_dumpAsText = false; |
385 m_generatePixelResults = true; | 386 m_generatePixelResults = true; |
386 m_dumpChildFrameScrollPositions = false; | 387 m_dumpChildFrameScrollPositions = false; |
387 m_dumpChildFramesAsText = false; | 388 m_dumpChildFramesAsText = false; |
388 m_dumpIconChanges = false; | 389 m_dumpIconChanges = false; |
389 m_dumpAsAudio = false; | 390 m_dumpAsAudio = false; |
390 m_dumpFrameLoadCallbacks = false; | 391 m_dumpFrameLoadCallbacks = false; |
(...skipping 1071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1462 return; | 1463 return; |
1463 } | 1464 } |
1464 int minWidth = cppVariantToInt32(arguments[0]); | 1465 int minWidth = cppVariantToInt32(arguments[0]); |
1465 int minHeight = cppVariantToInt32(arguments[1]); | 1466 int minHeight = cppVariantToInt32(arguments[1]); |
1466 WebKit::WebSize minSize(minWidth, minHeight); | 1467 WebKit::WebSize minSize(minWidth, minHeight); |
1467 | 1468 |
1468 int maxWidth = cppVariantToInt32(arguments[2]); | 1469 int maxWidth = cppVariantToInt32(arguments[2]); |
1469 int maxHeight = cppVariantToInt32(arguments[3]); | 1470 int maxHeight = cppVariantToInt32(arguments[3]); |
1470 WebKit::WebSize maxSize(maxWidth, maxHeight); | 1471 WebKit::WebSize maxSize(maxWidth, maxHeight); |
1471 | 1472 |
1472 m_webView->enableAutoResizeMode(minSize, maxSize); | 1473 m_delegate->enableAutoResizeMode(minSize, maxSize); |
1473 result->set(true); | 1474 result->set(true); |
1474 } | 1475 } |
1475 | 1476 |
1476 void TestRunner::disableAutoResizeMode(const CppArgumentList& arguments, CppVari
ant* result) | 1477 void TestRunner::disableAutoResizeMode(const CppArgumentList& arguments, CppVari
ant* result) |
1477 { | 1478 { |
1478 if (arguments.size() !=2) { | 1479 if (arguments.size() !=2) { |
1479 result->set(false); | 1480 result->set(false); |
1480 return; | 1481 return; |
1481 } | 1482 } |
1482 int newWidth = cppVariantToInt32(arguments[0]); | 1483 int newWidth = cppVariantToInt32(arguments[0]); |
1483 int newHeight = cppVariantToInt32(arguments[1]); | 1484 int newHeight = cppVariantToInt32(arguments[1]); |
1484 WebKit::WebSize newSize(newWidth, newHeight); | 1485 WebKit::WebSize newSize(newWidth, newHeight); |
1485 | 1486 |
1486 m_delegate->setClientWindowRect(WebRect(0, 0, newSize.width, newSize.height)
); | 1487 m_delegate->disableAutoResizeMode(newSize); |
1487 m_webView->disableAutoResizeMode(); | |
1488 m_webView->resize(newSize); | |
1489 result->set(true); | 1488 result->set(true); |
1490 } | 1489 } |
1491 | 1490 |
1492 void TestRunner::setMockDeviceOrientation(const CppArgumentList& arguments, CppV
ariant* result) | 1491 void TestRunner::setMockDeviceOrientation(const CppArgumentList& arguments, CppV
ariant* result) |
1493 { | 1492 { |
1494 result->setNull(); | 1493 result->setNull(); |
1495 if (arguments.size() < 6 || !arguments[0].isBool() || !arguments[1].isNumber
() || !arguments[2].isBool() || !arguments[3].isNumber() || !arguments[4].isBool
() || !arguments[5].isNumber()) | 1494 if (arguments.size() < 6 || !arguments[0].isBool() || !arguments[1].isNumber
() || !arguments[2].isBool() || !arguments[3].isNumber() || !arguments[4].isBool
() || !arguments[5].isNumber()) |
1496 return; | 1495 return; |
1497 | 1496 |
1498 WebDeviceOrientation orientation; | 1497 WebDeviceOrientation orientation; |
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2036 result->setNull(); | 2035 result->setNull(); |
2037 } | 2036 } |
2038 | 2037 |
2039 void TestRunner::setPointerLockWillFailSynchronously(const CppArgumentList&, Cpp
Variant* result) | 2038 void TestRunner::setPointerLockWillFailSynchronously(const CppArgumentList&, Cpp
Variant* result) |
2040 { | 2039 { |
2041 m_pointerLockPlannedResult = PointerLockWillFailSync; | 2040 m_pointerLockPlannedResult = PointerLockWillFailSync; |
2042 result->setNull(); | 2041 result->setNull(); |
2043 } | 2042 } |
2044 | 2043 |
2045 } | 2044 } |
OLD | NEW |