Chromium Code Reviews| 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 "base/base_paths.h" | 5 #include "base/base_paths.h" |
| 6 #include "base/file_path.h" | 6 #include "base/file_path.h" |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/sys_info.h" | 10 #include "base/sys_info.h" |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 21 #include "chrome/test/automation/window_proxy.h" | 21 #include "chrome/test/automation/window_proxy.h" |
| 22 #include "chrome/test/ui/ui_test.h" | 22 #include "chrome/test/ui/ui_test.h" |
| 23 #include "grit/chromium_strings.h" | 23 #include "grit/chromium_strings.h" |
| 24 #include "grit/generated_resources.h" | 24 #include "grit/generated_resources.h" |
| 25 #include "net/base/net_util.h" | 25 #include "net/base/net_util.h" |
| 26 #include "net/test/test_server.h" | 26 #include "net/test/test_server.h" |
| 27 #include "ui/gfx/native_widget_types.h" | 27 #include "ui/gfx/native_widget_types.h" |
| 28 | 28 |
| 29 namespace { | 29 namespace { |
| 30 | 30 |
| 31 class BrowserTest : public UITest { | 31 class BrowserUITest : public UITest { |
| 32 }; | 32 }; |
| 33 | 33 |
| 34 class VisibleBrowserTest : public UITest { | 34 class VisibleBrowserTest : public UITest { |
| 35 protected: | 35 protected: |
| 36 VisibleBrowserTest() : UITest() { | 36 VisibleBrowserTest() : UITest() { |
| 37 show_window_ = true; | 37 show_window_ = true; |
| 38 } | 38 } |
| 39 }; | 39 }; |
| 40 | 40 |
| 41 } // namespace | 41 } // namespace |
| 42 | 42 |
| 43 // The browser should quit quickly if it receives a WM_ENDSESSION message | 43 // The browser should quit quickly if it receives a WM_ENDSESSION message |
| 44 // on Windows, or SIGTERM on posix. | 44 // on Windows, or SIGTERM on posix. |
| 45 TEST_F(BrowserTest, SessionEnd) { | 45 TEST_F(BrowserUITest, SessionEnd) { |
|
scheib
2012/03/26 23:43:30
Done.
| |
| 46 FilePath test_file(test_data_directory_); | 46 FilePath test_file(test_data_directory_); |
| 47 test_file = test_file.AppendASCII("title1.html"); | 47 test_file = test_file.AppendASCII("title1.html"); |
| 48 | 48 |
| 49 NavigateToURL(net::FilePathToFileURL(test_file)); | 49 NavigateToURL(net::FilePathToFileURL(test_file)); |
| 50 TerminateBrowser(); | 50 TerminateBrowser(); |
| 51 } | 51 } |
| 52 | 52 |
| 53 TEST_F(VisibleBrowserTest, WindowOpenClose) { | 53 TEST_F(VisibleBrowserTest, WindowOpenClose) { |
| 54 FilePath test_file(test_data_directory_); | 54 FilePath test_file(test_data_directory_); |
| 55 test_file = test_file.AppendASCII("window.close.html"); | 55 test_file = test_file.AppendASCII("window.close.html"); |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 231 | 231 |
| 232 // Verify that the window is present. | 232 // Verify that the window is present. |
| 233 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); | 233 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); |
| 234 ASSERT_TRUE(browser.get()); | 234 ASSERT_TRUE(browser.get()); |
| 235 | 235 |
| 236 // Verify the browser is in application mode. | 236 // Verify the browser is in application mode. |
| 237 bool is_application; | 237 bool is_application; |
| 238 ASSERT_TRUE(browser->IsApplication(&is_application)); | 238 ASSERT_TRUE(browser->IsApplication(&is_application)); |
| 239 EXPECT_TRUE(is_application); | 239 EXPECT_TRUE(is_application); |
| 240 } | 240 } |
| OLD | NEW |