1/* 2 * Copyright (C) 2010 Apple Inc. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. 9 * 2. Redistributions in binary form must reproduce the above copyright 10 * notice, this list of conditions and the following disclaimer in the 11 * documentation and/or other materials provided with the distribution. 12 * 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' 14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS 17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 * THE POSSIBILITY OF SUCH DAMAGE. 24 */ 25 26module WTR { 27 28 interface LayoutTestController { 29 // The basics. 30 void dumpAsText(); 31 void dumpChildFramesAsText(); 32 void waitUntilDone(); 33 void notifyDone(); 34 35 // Other dumping. 36 void dumpBackForwardList(); 37 void dumpChildFrameScrollPositions(); 38 void dumpEditingCallbacks(); 39 void dumpSelectionRect(); 40 void dumpStatusCallbacks(); 41 void dumpTitleChanges(); 42 void dumpFullScreenCallbacks(); 43 44 // Special options. 45 void keepWebHistory(); 46 void setAcceptsEditing(in boolean value); 47 void setCanOpenWindows(in boolean value); 48 void setCloseRemainingWindowsWhenComplete(in boolean value); 49 void setXSSAuditorEnabled(in boolean value); 50 void setAllowUniversalAccessFromFileURLs(in boolean value); 51 void setAllowFileAccessFromFileURLs(in boolean value); 52 53 // Special DOM functions. 54 void clearBackForwardList(); 55 object computedStyleIncludingVisitedInfo(in object element); 56 DOMString counterValueForElementById(in DOMString elementId); 57 void execCommand(in DOMString name, in DOMString argument); 58 boolean isCommandEnabled(in DOMString name); 59 DOMString markerTextForListItem(in object element); 60 unsigned long windowCount(); 61 object shadowRoot(in object element); 62 63 // Repaint testing. 64 void testRepaint(); 65 void repaintSweepHorizontally(); 66 void display(); 67 68 // Printing 69 int numberOfPages(in double pageWidthInPixels, in double pageHeightInPixels); 70 int pageNumberForElementById(in DOMString id, in double pageWidthInPixels, in double pageHeightInPixels); 71 DOMString pageSizeAndMarginsInPixels(in int pageIndex, in int width, in int height, in int marginTop, in int marginRight, in int marginBottom, in int marginLeft); 72 boolean isPageBoxVisible(in int pageIndex); 73 74 // Animation testing. 75 int numberOfActiveAnimations(); 76 boolean pauseAnimationAtTimeOnElementWithId(in DOMString animationName, in double time, in DOMString elementId); 77 void suspendAnimations(); 78 void resumeAnimations(); 79 80 // UserContent testing. 81 void addUserScript(in DOMString source, in boolean runAtStart, in boolean allFrames); 82 void addUserStyleSheet(in DOMString source, in boolean allFrames); 83 84 // Local storage API 85 void clearAllDatabases(); 86 void setDatabaseQuota(in unsigned long long quota); 87 DOMString pathToLocalResource(in DOMString url); 88 89 // Compositing testing. 90 DOMString layerTreeAsText(); 91 92 // Text search testing. 93 boolean findString(in DOMString target, in object optionsArray); 94 95 // Evaluating script in a special context. 96 [PassContext] void evaluateScriptInIsolatedWorld(in unsigned long worldID, in DOMString script); 97 98 // For Web Inspector tests 99 void showWebInspector(); 100 void closeWebInspector(); 101 void evaluateInWebInspector(in long callID, in DOMString script); 102 void setTimelineProfilingEnabled(in boolean enabled); 103 104 void setPOSIXLocale(in DOMString locale); 105 106 void setWillSendRequestReturnsNull(in boolean flag); 107 }; 108 109} 110