| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "webkit/tools/test_shell/test_shell.h" | 5 #include "webkit/tools/test_shell/test_shell.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <fcntl.h> | 8 #include <fcntl.h> |
| 9 #include <fontconfig/fontconfig.h> | 9 #include <fontconfig/fontconfig.h> |
| 10 #include <gtk/gtk.h> | 10 #include <gtk/gtk.h> |
| (...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 iter != TestShell::windowList()->end(); iter++) { | 482 iter != TestShell::windowList()->end(); iter++) { |
| 483 GtkWindow* window = *iter; | 483 GtkWindow* window = *iter; |
| 484 TestShell* shell = | 484 TestShell* shell = |
| 485 static_cast<TestShell*>(g_object_get_data(G_OBJECT(window), | 485 static_cast<TestShell*>(g_object_get_data(G_OBJECT(window), |
| 486 "test-shell")); | 486 "test-shell")); |
| 487 shell->DumpBackForwardList(result); | 487 shell->DumpBackForwardList(result); |
| 488 } | 488 } |
| 489 } | 489 } |
| 490 | 490 |
| 491 void TestShell::LoadURLForFrame(const GURL& url, | 491 void TestShell::LoadURLForFrame(const GURL& url, |
| 492 const std::wstring& frame_name) { | 492 const string16& frame_name) { |
| 493 if (!url.is_valid()) | 493 if (!url.is_valid()) |
| 494 return; | 494 return; |
| 495 | 495 |
| 496 if (IsSVGTestURL(url)) { | 496 if (IsSVGTestURL(url)) { |
| 497 SizeToSVG(); | 497 SizeToSVG(); |
| 498 } else { | 498 } else { |
| 499 // only resize back to the default when running tests | 499 // only resize back to the default when running tests |
| 500 if (layout_test_mode()) | 500 if (layout_test_mode()) |
| 501 SizeToDefault(); | 501 SizeToDefault(); |
| 502 } | 502 } |
| 503 | 503 |
| 504 navigation_controller_->LoadEntry( | 504 navigation_controller_->LoadEntry( |
| 505 new TestNavigationEntry(-1, url, std::wstring(), frame_name)); | 505 new TestNavigationEntry(-1, url, frame_name)); |
| 506 } | 506 } |
| 507 | 507 |
| 508 bool TestShell::PromptForSaveFile(const wchar_t* prompt_title, | 508 bool TestShell::PromptForSaveFile(const wchar_t* prompt_title, |
| 509 FilePath* result) { | 509 FilePath* result) { |
| 510 GtkWidget* dialog; | 510 GtkWidget* dialog; |
| 511 dialog = gtk_file_chooser_dialog_new(WideToUTF8(prompt_title).c_str(), | 511 dialog = gtk_file_chooser_dialog_new(WideToUTF8(prompt_title).c_str(), |
| 512 GTK_WINDOW(m_mainWnd), | 512 GTK_WINDOW(m_mainWnd), |
| 513 GTK_FILE_CHOOSER_ACTION_SAVE, | 513 GTK_FILE_CHOOSER_ACTION_SAVE, |
| 514 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, | 514 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, |
| 515 GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, | 515 GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 switch (resource_id) { | 571 switch (resource_id) { |
| 572 case IDR_BROKENIMAGE: | 572 case IDR_BROKENIMAGE: |
| 573 resource_id = IDR_BROKENIMAGE_TESTSHELL; | 573 resource_id = IDR_BROKENIMAGE_TESTSHELL; |
| 574 break; | 574 break; |
| 575 case IDR_TEXTAREA_RESIZER: | 575 case IDR_TEXTAREA_RESIZER: |
| 576 resource_id = IDR_TEXTAREA_RESIZER_TESTSHELL; | 576 resource_id = IDR_TEXTAREA_RESIZER_TESTSHELL; |
| 577 break; | 577 break; |
| 578 } | 578 } |
| 579 return TestShell::ResourceProvider(resource_id); | 579 return TestShell::ResourceProvider(resource_id); |
| 580 } | 580 } |
| OLD | NEW |