| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/printing/print_dialog_cloud.h" | 5 #include "chrome/browser/printing/print_dialog_cloud.h" |
| 6 #include "chrome/browser/printing/print_dialog_cloud_internal.h" | 6 #include "chrome/browser/printing/print_dialog_cloud_internal.h" |
| 7 | 7 |
| 8 #include <functional> | 8 #include <functional> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 const char* GetTestData() { | 47 const char* GetTestData() { |
| 48 // Fetching this data blocks the IO thread, but we don't really care because | 48 // Fetching this data blocks the IO thread, but we don't really care because |
| 49 // this is a test. | 49 // this is a test. |
| 50 base::ThreadRestrictions::ScopedAllowIO allow_io; | 50 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 51 | 51 |
| 52 if (test_data_.empty()) { | 52 if (test_data_.empty()) { |
| 53 base::FilePath test_data_directory; | 53 base::FilePath test_data_directory; |
| 54 PathService::Get(chrome::DIR_TEST_DATA, &test_data_directory); | 54 PathService::Get(chrome::DIR_TEST_DATA, &test_data_directory); |
| 55 base::FilePath test_file = | 55 base::FilePath test_file = |
| 56 test_data_directory.AppendASCII("printing/cloud_print_uitest.html"); | 56 test_data_directory.AppendASCII("printing/cloud_print_uitest.html"); |
| 57 file_util::ReadFileToString(test_file, &test_data_); | 57 base::ReadFileToString(test_file, &test_data_); |
| 58 } | 58 } |
| 59 return test_data_.c_str(); | 59 return test_data_.c_str(); |
| 60 } | 60 } |
| 61 private: | 61 private: |
| 62 TestData() {} | 62 TestData() {} |
| 63 | 63 |
| 64 std::string test_data_; | 64 std::string test_data_; |
| 65 | 65 |
| 66 friend struct DefaultSingletonTraits<TestData>; | 66 friend struct DefaultSingletonTraits<TestData>; |
| 67 }; | 67 }; |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 BrowserWindow* window = browser()->window(); | 275 BrowserWindow* window = browser()->window(); |
| 276 ASSERT_TRUE(window); | 276 ASSERT_TRUE(window); |
| 277 gfx::NativeWindow native_window = window->GetNativeWindow(); | 277 gfx::NativeWindow native_window = window->GetNativeWindow(); |
| 278 ASSERT_TRUE(native_window); | 278 ASSERT_TRUE(native_window); |
| 279 bool key_sent = ui_controls::SendKeyPress(native_window, ui::VKEY_ESCAPE, | 279 bool key_sent = ui_controls::SendKeyPress(native_window, ui::VKEY_ESCAPE, |
| 280 false, false, false, false); | 280 false, false, false, false); |
| 281 EXPECT_TRUE(key_sent); | 281 EXPECT_TRUE(key_sent); |
| 282 if (key_sent) | 282 if (key_sent) |
| 283 tab_closed_observer.Wait(); | 283 tab_closed_observer.Wait(); |
| 284 } | 284 } |
| OLD | NEW |