Changeset 183651 in webkit
- Timestamp:
- Apr 30, 2015 4:13:52 PM (9 years ago)
- Location:
- trunk/Tools
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r183641 r183651 1 2015-04-30 Brent Fulgham <bfulgham@apple.com> 2 3 Provide a runtime flag to run-webkit-tests that shows the test view 4 https://bugs.webkit.org/show_bug.cgi?id=144079. 5 6 Reviewed by Dean Jackson. 7 8 Add a new flag (--show-webview) that causes DumpRenderTree and WebKitTestRunner to display 9 their WebViews on-screen. This can be used when running tests via the "--additional-drt-flag" 10 option: 11 12 --additional-drt-flag="--show-webview" 13 14 * DumpRenderTree/mac/DumpRenderTree.mm: 15 (createWebViewAndOffscreenWindow): Use an on-screen window rect if the user passed the 16 '--show-webview' flag. 17 (initializeGlobalsFromCommandLineOptions): Recognize the "--show-webview" option. 18 * WebKitTestRunner/Options.cpp: 19 (WTR::Options::Options): 20 (WTR::handleOptionShowWebView): 21 (WTR::OptionsHandler::OptionsHandler): Recognize the new "--show-webview" option. 22 * WebKitTestRunner/Options.h: 23 * WebKitTestRunner/TestController.cpp: 24 (WTR::TestController::TestController): 25 (WTR::TestController::initialize): Use value of 'shouldShowWebView' from the Options bundle. 26 * WebKitTestRunner/TestController.h: 27 (WTR::TestController::shouldShowWebView): 28 * WebKitTestRunner/mac/PlatformWebViewMac.mm: 29 (WTR::PlatformWebView::PlatformWebView): Retrieve the value of the 'ShouldShowWebView' key from the 30 options dictionary. If it is true, display the web view while running the test. 31 1 32 2015-04-30 Alexey Proskuryakov <ap@apple.com> 2 33 -
trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm
r183595 r183651 1 1 /* 2 * Copyright (C) 2005 , 2006, 2007, 2008, 2009Apple Inc. All rights reserved.2 * Copyright (C) 2005-2009, 2015 Apple Inc. All rights reserved. 3 3 * (C) 2007 Graham Dennis (graham.dennis@gmail.com) 4 4 * … … 206 206 static int useAcceleratedDrawing; 207 207 static int gcBetweenTests; 208 static int showWebView = NO; 208 209 static BOOL printSeparators; 209 210 static RetainPtr<CFStringRef> persistentUserStyleSheetLocation; … … 785 786 // Put it at -10000, -10000 in "flipped coordinates", since WebCore and the DOM use flipped coordinates. 786 787 NSScreen *firstScreen = [[NSScreen screens] firstObject]; 787 NSRect windowRect = NSOffsetRect(rect, -10000, [firstScreen frame].size.height - rect.size.height + 10000);788 NSRect windowRect = (showWebView) ? NSOffsetRect(rect, 100, 100) : NSOffsetRect(rect, -10000, [firstScreen frame].size.height - rect.size.height + 10000); 788 789 DumpRenderTreeWindow *window = [[DumpRenderTreeWindow alloc] initWithContentRect:windowRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES]; 789 790 … … 791 792 [window setCollectionBehavior:NSWindowCollectionBehaviorStationary]; 792 793 [[window contentView] addSubview:webView]; 793 [window orderBack:nil]; 794 if (showWebView) 795 [window orderFront:nil]; 796 else 797 [window orderBack:nil]; 794 798 [window setAutodisplay:NO]; 795 799 … … 1122 1126 {"no-timeout", no_argument, &useTimeoutWatchdog, NO}, 1123 1127 {"allowed-host", required_argument, nullptr, 'a'}, 1128 {"show-webview", no_argument, &showWebView, YES}, 1124 1129 {nullptr, 0, nullptr, 0} 1125 1130 }; -
trunk/Tools/WebKitTestRunner/Options.cpp
r182916 r183651 2 2 * Copyright (C) 2013 University of Szeged. All rights reserved. 3 3 * Copyright (C) 2013 Samsung Electronics. All rights reserved. 4 * Copyright (C) 2015 Apple Inc. All rights reserved. 4 5 * 5 6 * Redistribution and use in source and binary forms, with or without … … 42 43 , shouldUseAcceleratedDrawing(false) 43 44 , shouldUseRemoteLayerTree(false) 45 , shouldShowWebView(false) 44 46 { 45 47 } … … 94 96 } 95 97 98 bool handleOptionShowWebView(Options& options, const char*, const char*) 99 { 100 options.shouldShowWebView = true; 101 return true; 102 } 103 96 104 bool handleOptionAllowedHost(Options& options, const char*, const char* host) 97 105 { … … 121 129 optionList.append(Option("--remote-layer-tree", "Use remote layer tree.", handleOptionRemoteLayerTree)); 122 130 optionList.append(Option("--allowed-host", "Allows access to the specified host from tests.", handleOptionAllowedHost, true)); 131 optionList.append(Option("--show-webview", "Show the WebView during test runs (for Debugging)", handleOptionShowWebView)); 123 132 124 133 optionList.append(Option(0, 0, handleOptionUnmatched)); -
trunk/Tools/WebKitTestRunner/Options.h
r182017 r183651 2 2 * Copyright (C) 2013 University of Szeged. All rights reserved. 3 3 * Copyright (C) 2013 Samsung Electronics. All rights reserved. 4 * Copyright (C) 2015 Apple Inc. All rights reserved. 4 5 * 5 6 * Redistribution and use in source and binary forms, with or without … … 47 48 bool shouldUseAcceleratedDrawing; 48 49 bool shouldUseRemoteLayerTree; 50 bool shouldShowWebView; 49 51 std::vector<std::string> paths; 50 52 std::vector<std::string> allowedHosts; -
trunk/Tools/WebKitTestRunner/TestController.cpp
r183595 r183651 1 1 /* 2 * Copyright (C) 2010, 2014 Apple Inc. All rights reserved.2 * Copyright (C) 2010, 2014-2015 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 126 126 , m_shouldUseRemoteLayerTree(false) 127 127 , m_shouldLogHistoryClientCallbacks(false) 128 , m_shouldShowWebView(false) 128 129 { 129 130 initialize(argc, argv); … … 329 330 m_paths = options.paths; 330 331 m_allowedHosts = options.allowedHosts; 332 m_shouldShowWebView = options.shouldShowWebView; 331 333 332 334 if (options.printSupportedFeatures) { -
trunk/Tools/WebKitTestRunner/TestController.h
r183572 r183651 1 1 /* 2 * Copyright (C) 2010 Apple Inc. All rights reserved.2 * Copyright (C) 2010, 2015 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 75 75 void runUntil(bool& done, double timeoutSeconds); 76 76 void notifyDone(); 77 77 78 bool shouldShowWebView() const { return m_shouldShowWebView; } 79 78 80 void configureViewForTest(const TestInvocation&); 79 81 … … 270 272 271 273 bool m_shouldLogHistoryClientCallbacks; 274 bool m_shouldShowWebView; 272 275 273 276 std::unique_ptr<EventSenderProxy> m_eventSenderProxy; -
trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm
r181451 r183651 1 1 /* 2 * Copyright (C) 2010, 2013 Apple Inc. All rights reserved.2 * Copyright (C) 2010, 2013, 2015 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 142 142 [m_view setWindowOcclusionDetectionEnabled:NO]; 143 143 144 WKRetainPtr<WKStringRef> shouldShowWebViewKey(AdoptWK, WKStringCreateWithUTF8CString("ShouldShowWebView")); 145 WKTypeRef shouldShowWebViewValue = options ? WKDictionaryGetItemForKey(options, shouldShowWebViewKey.get()) : NULL; 146 bool shouldShowWebView = shouldShowWebViewValue && WKBooleanGetValue(static_cast<WKBooleanRef>(shouldShowWebViewValue)); 147 144 148 NSScreen *firstScreen = [[NSScreen screens] objectAtIndex:0]; 145 NSRect windowRect = NSOffsetRect(rect, -10000, [firstScreen frame].size.height - rect.size.height + 10000);149 NSRect windowRect = (shouldShowWebView) ? NSOffsetRect(rect, 100, 100) : NSOffsetRect(rect, -10000, [firstScreen frame].size.height - rect.size.height + 10000); 146 150 m_window = [[WebKitTestRunnerWindow alloc] initWithContentRect:windowRect styleMask:NSBorderlessWindowMask backing:(NSBackingStoreType)_NSBackingStoreUnbuffered defer:YES]; 147 151 m_window.platformWebView = this; … … 149 153 [m_window setCollectionBehavior:NSWindowCollectionBehaviorStationary]; 150 154 [[m_window contentView] addSubview:m_view]; 151 [m_window orderBack:nil]; 155 if (shouldShowWebView) 156 [m_window orderFront:nil]; 157 else 158 [m_window orderBack:nil]; 152 159 [m_window setReleasedWhenClosed:NO]; 153 160 }
Note: See TracChangeset
for help on using the changeset viewer.