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

Side by Side Diff: Tools/DumpRenderTree/chromium/TestShell.cpp

Issue 14975008: test-shell is outside of the screen when running layout tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@menupopup
Patch Set: Created 7 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 #include <wtf/OwnArrayPtr.h> 65 #include <wtf/OwnArrayPtr.h>
66 66
67 67
68 using namespace WebKit; 68 using namespace WebKit;
69 using namespace WebTestRunner; 69 using namespace WebTestRunner;
70 using namespace std; 70 using namespace std;
71 71
72 // Content area size for newly created windows. 72 // Content area size for newly created windows.
73 static const int testWindowWidth = 800; 73 static const int testWindowWidth = 800;
74 static const int testWindowHeight = 600; 74 static const int testWindowHeight = 600;
75 static const int testWindowMargin = 8;
tkent 2013/05/13 21:24:03 should move screenUnavailableBorder in WebViewHost
75 76
76 // The W3C SVG layout tests use a different size than the other layout tests. 77 // The W3C SVG layout tests use a different size than the other layout tests.
77 static const int SVGTestWindowWidth = 480; 78 static const int SVGTestWindowWidth = 480;
78 static const int SVGTestWindowHeight = 360; 79 static const int SVGTestWindowHeight = 360;
79 80
80 static const char layoutTestsPattern[] = "/LayoutTests/"; 81 static const char layoutTestsPattern[] = "/LayoutTests/";
81 static const string::size_type layoutTestsPatternSize = sizeof(layoutTestsPatter n) - 1; 82 static const string::size_type layoutTestsPatternSize = sizeof(layoutTestsPatter n) - 1;
82 static const char fileUrlPattern[] = "file:/"; 83 static const char fileUrlPattern[] = "file:/";
83 static const char fileTestPrefix[] = "(file test):"; 84 static const char fileTestPrefix[] = "(file test):";
84 static const char dataUrlPattern[] = "data:"; 85 static const char dataUrlPattern[] = "data:";
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 void TestShell::resizeWindowForTest(WebViewHost* window, const WebURL& url) 259 void TestShell::resizeWindowForTest(WebViewHost* window, const WebURL& url)
259 { 260 {
260 int width, height; 261 int width, height;
261 if (isSVGTestURL(url)) { 262 if (isSVGTestURL(url)) {
262 width = SVGTestWindowWidth; 263 width = SVGTestWindowWidth;
263 height = SVGTestWindowHeight; 264 height = SVGTestWindowHeight;
264 } else { 265 } else {
265 width = testWindowWidth; 266 width = testWindowWidth;
266 height = testWindowHeight; 267 height = testWindowHeight;
267 } 268 }
268 window->setWindowRect(WebRect(0, 0, width + virtualWindowBorder * 2, height + virtualWindowBorder * 2)); 269 window->setWindowRect(WebRect(testWindowMargin, testWindowMargin, width + vi rtualWindowBorder * 2, height + virtualWindowBorder * 2));
269 } 270 }
270 271
271 void TestShell::resetTestController() 272 void TestShell::resetTestController()
272 { 273 {
273 resetWebSettings(*webView()); 274 resetWebSettings(*webView());
274 m_testInterfaces->resetAll(); 275 m_testInterfaces->resetAll();
275 m_devToolsTestInterfaces->resetAll(); 276 m_devToolsTestInterfaces->resetAll();
276 m_webViewHost->reset(); 277 m_webViewHost->reset();
277 m_drtDevToolsAgent->reset(); 278 m_drtDevToolsAgent->reset();
278 if (m_drtDevToolsClient) 279 if (m_drtDevToolsClient)
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 for (size_t index = 0; index < entryCount; ++index) { 555 for (size_t index = 0; index < entryCount; ++index) {
555 WebHistoryItem historyItem = navigationController.entryAtIndex(index)->c ontentState(); 556 WebHistoryItem historyItem = navigationController.entryAtIndex(index)->c ontentState();
556 if (historyItem.isNull()) { 557 if (historyItem.isNull()) {
557 historyItem.initialize(); 558 historyItem.initialize();
558 historyItem.setURLString(navigationController.entryAtIndex(index)->U RL().spec().utf16()); 559 historyItem.setURLString(navigationController.entryAtIndex(index)->U RL().spec().utf16());
559 } 560 }
560 result[index] = historyItem; 561 result[index] = historyItem;
561 } 562 }
562 history->swap(result); 563 history->swap(result);
563 } 564 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698