OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/gfx/gdi_util.h" | 7 #include "base/gfx/gdi_util.h" |
8 #include "skia/ext/platform_device.h" | 8 #include "skia/ext/platform_device.h" |
9 #include "base/gfx/png_decoder.h" | 9 #include "base/gfx/png_decoder.h" |
10 #include "base/gfx/png_encoder.h" | 10 #include "base/gfx/png_encoder.h" |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 const bool ignore_alpha_; | 197 const bool ignore_alpha_; |
198 | 198 |
199 DISALLOW_EVIL_CONSTRUCTORS(Image); | 199 DISALLOW_EVIL_CONSTRUCTORS(Image); |
200 }; | 200 }; |
201 | 201 |
202 class PrintingLayoutTest : public PrintingTest<UITest> { | 202 class PrintingLayoutTest : public PrintingTest<UITest> { |
203 public: | 203 public: |
204 PrintingLayoutTest() { | 204 PrintingLayoutTest() { |
205 emf_path_ = browser_directory_; | 205 emf_path_ = browser_directory_; |
206 file_util::AppendToPath(&emf_path_, L"emf_dumps"); | 206 file_util::AppendToPath(&emf_path_, L"emf_dumps"); |
207 std::wstring arg(L" --debug-print=\""); | 207 launch_arguments_.AppendSwitchWithValue(L"debug-print", L'"' + emf_path_ + L
'"'); |
208 arg += emf_path_; | |
209 arg += L"\""; | |
210 launch_arguments_.append(arg); | |
211 show_window_ = true; | 208 show_window_ = true; |
212 } | 209 } |
213 | 210 |
214 virtual void SetUp() { | 211 virtual void SetUp() { |
215 // Make sure there is no left overs. | 212 // Make sure there is no left overs. |
216 CleanupDumpDirectory(); | 213 CleanupDumpDirectory(); |
217 UITest::SetUp(); | 214 UITest::SetUp(); |
218 } | 215 } |
219 | 216 |
220 virtual void TearDown() { | 217 virtual void TearDown() { |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 if (found_emf && found_prn) | 361 if (found_emf && found_prn) |
365 break; | 362 break; |
366 Sleep(100); | 363 Sleep(100); |
367 } | 364 } |
368 EXPECT_TRUE(found_emf) << ".PRN file is: " << prn_file; | 365 EXPECT_TRUE(found_emf) << ".PRN file is: " << prn_file; |
369 EXPECT_TRUE(found_prn) << ".EMF file is: " << emf_file; | 366 EXPECT_TRUE(found_prn) << ".EMF file is: " << emf_file; |
370 return emf_file; | 367 return emf_file; |
371 } | 368 } |
372 | 369 |
373 static bool GenerateFiles() { | 370 static bool GenerateFiles() { |
374 return CommandLine().HasSwitch(kGenerateSwitch); | 371 return CommandLine::ForCurrentProcess()->HasSwitch(kGenerateSwitch); |
375 } | 372 } |
376 | 373 |
377 const std::wstring& emf_path() const { return emf_path_; } | 374 const std::wstring& emf_path() const { return emf_path_; } |
378 | 375 |
379 std::wstring emf_path_; | 376 std::wstring emf_path_; |
380 | 377 |
381 DISALLOW_EVIL_CONSTRUCTORS(PrintingLayoutTest); | 378 DISALLOW_EVIL_CONSTRUCTORS(PrintingLayoutTest); |
382 }; | 379 }; |
383 | 380 |
384 // Tests that don't need UI access. | 381 // Tests that don't need UI access. |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
631 url = server->TestServerPage("files/printing/test1.html"); | 628 url = server->TestServerPage("files/printing/test1.html"); |
632 EXPECT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, | 629 EXPECT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, |
633 tab_proxy->NavigateToURL(url)); | 630 tab_proxy->NavigateToURL(url)); |
634 } | 631 } |
635 CloseBrowserAndServer(); | 632 CloseBrowserAndServer(); |
636 | 633 |
637 EXPECT_EQ(0., CompareWithResult(L"iframe")) | 634 EXPECT_EQ(0., CompareWithResult(L"iframe")) |
638 << L"iframe"; | 635 << L"iframe"; |
639 } | 636 } |
640 | 637 |
OLD | NEW |