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

Side by Side Diff: chrome/browser/printing/printing_layout_uitest.cc

Issue 1814002: Remove deprecated things from net test suite: (Closed)
Patch Set: Created 10 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
OLDNEW
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/file_util.h" 6 #include "base/file_util.h"
7 #include "base/simple_thread.h" 7 #include "base/simple_thread.h"
8 #include "base/test/test_file_util.h" 8 #include "base/test/test_file_util.h"
9 #include "base/win_util.h" 9 #include "base/win_util.h"
10 #include "chrome/common/chrome_paths.h" 10 #include "chrome/common/chrome_paths.h"
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 ASSERT_TRUE(NULL != server.get()); 297 ASSERT_TRUE(NULL != server.get());
298 298
299 NavigateToURL(server->TestServerPage("files/printing/test1.html")); 299 NavigateToURL(server->TestServerPage("files/printing/test1.html"));
300 close_printdlg_thread.Start(); 300 close_printdlg_thread.Start();
301 PrintNowTab(); 301 PrintNowTab();
302 close_printdlg_thread.Join(); 302 close_printdlg_thread.Join();
303 EXPECT_EQ(0., CompareWithResult(L"test1")); 303 EXPECT_EQ(0., CompareWithResult(L"test1"));
304 } 304 }
305 305
306 struct TestPool { 306 struct TestPool {
307 const wchar_t* source; 307 const char* source;
308 const wchar_t* result; 308 const wchar_t* result;
309 }; 309 };
310 310
311 const TestPool kTestPool[] = { 311 const TestPool kTestPool[] = {
312 // ImagesB&W 312 // ImagesB&W
313 L"files/printing/test2.html", L"test2", 313 "files/printing/test2.html", L"test2",
314 // ImagesTransparent 314 // ImagesTransparent
315 L"files/printing/test3.html", L"test3", 315 "files/printing/test3.html", L"test3",
316 // ImageColor 316 // ImageColor
317 L"files/printing/test4.html", L"test4", 317 "files/printing/test4.html", L"test4",
318 // TODO(maruel): http://b/1171450 Transparent overlays are drawn opaque 318 // TODO(maruel): http://b/1171450 Transparent overlays are drawn opaque
319 // L"files/printing/test5.html", L"test5", 319 // "files/printing/test5.html", L"test5",
320 }; 320 };
321 321
322 // TODO(maruel:) http://code.google.com/p/chromium/issues/detail?id=7721 322 // TODO(maruel:) http://code.google.com/p/chromium/issues/detail?id=7721
323 TEST_F(PrintingLayoutTestHidden, DISABLED_ManyTimes) { 323 TEST_F(PrintingLayoutTestHidden, DISABLED_ManyTimes) {
324 if (IsTestCaseDisabled()) 324 if (IsTestCaseDisabled())
325 return; 325 return;
326 326
327 scoped_refptr<HTTPTestServer> server( 327 scoped_refptr<HTTPTestServer> server(
328 HTTPTestServer::CreateServer(kDocRoot, NULL)); 328 HTTPTestServer::CreateServer(kDocRoot, NULL));
329 ASSERT_TRUE(NULL != server.get()); 329 ASSERT_TRUE(NULL != server.get());
330 DismissTheWindow dismisser(base::GetProcId(process())); 330 DismissTheWindow dismisser(base::GetProcId(process()));
331 331
332 ASSERT_GT(arraysize(kTestPool), 0u); 332 ASSERT_GT(arraysize(kTestPool), 0u);
333 for (int i = 0; i < arraysize(kTestPool); ++i) { 333 for (int i = 0; i < arraysize(kTestPool); ++i) {
334 if (i) 334 if (i)
335 CleanupDumpDirectory(); 335 CleanupDumpDirectory();
336 const TestPool& test = kTestPool[i % arraysize(kTestPool)]; 336 const TestPool& test = kTestPool[i % arraysize(kTestPool)];
337 NavigateToURL(server->TestServerPageW(test.source)); 337 NavigateToURL(server->TestServerPage(test.source));
338 base::DelegateSimpleThread close_printdlg_thread1(&dismisser, 338 base::DelegateSimpleThread close_printdlg_thread1(&dismisser,
339 "close_printdlg_thread"); 339 "close_printdlg_thread");
340 EXPECT_EQ(NULL, FindDialogWindow(dismisser.owner_process())); 340 EXPECT_EQ(NULL, FindDialogWindow(dismisser.owner_process()));
341 close_printdlg_thread1.Start(); 341 close_printdlg_thread1.Start();
342 PrintNowTab(); 342 PrintNowTab();
343 close_printdlg_thread1.Join(); 343 close_printdlg_thread1.Join();
344 EXPECT_EQ(0., CompareWithResult(test.result)) << test.result; 344 EXPECT_EQ(0., CompareWithResult(test.result)) << test.result;
345 CleanupDumpDirectory(); 345 CleanupDumpDirectory();
346 base::DelegateSimpleThread close_printdlg_thread2(&dismisser, 346 base::DelegateSimpleThread close_printdlg_thread2(&dismisser,
347 "close_printdlg_thread"); 347 "close_printdlg_thread");
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 429
430 // Force a navigation elsewhere to verify that it's fine with it. 430 // Force a navigation elsewhere to verify that it's fine with it.
431 url = server->TestServerPage("files/printing/test1.html"); 431 url = server->TestServerPage("files/printing/test1.html");
432 EXPECT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, 432 EXPECT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS,
433 tab_proxy->NavigateToURL(url)); 433 tab_proxy->NavigateToURL(url));
434 } 434 }
435 CloseBrowserAndServer(); 435 CloseBrowserAndServer();
436 436
437 EXPECT_EQ(0., CompareWithResult(L"iframe")) << L"iframe"; 437 EXPECT_EQ(0., CompareWithResult(L"iframe")) << L"iframe";
438 } 438 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698