[email protected] | 3dd52d76 | 2012-01-20 10:25:12 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
license.bot | bf09a50 | 2008-08-24 00:55:55 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 4 | |
5 | // This is a file for random testcases that we run into that at one point or | ||||
6 | // another have crashed the program. | ||||
7 | |||||
8 | #include "chrome/test/ui/ui_test.h" | ||||
9 | |||||
10 | #include "base/basictypes.h" | ||||
[email protected] | 4b68e0d | 2009-05-02 00:56:57 | [diff] [blame] | 11 | #include "base/file_path.h" |
[email protected] | 28de7d94 | 2010-02-23 01:43:04 | [diff] [blame] | 12 | #include "chrome/common/chrome_switches.h" |
[email protected] | 95edc39 | 2010-07-30 22:00:38 | [diff] [blame] | 13 | #include "net/base/net_util.h" |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 14 | |
15 | class GoogleTest : public UITest { | ||||
16 | protected: | ||||
17 | GoogleTest() : UITest() { | ||||
[email protected] | 95edc39 | 2010-07-30 22:00:38 | [diff] [blame] | 18 | FilePath test_file = |
19 | test_data_directory_.AppendASCII("google").AppendASCII("google.html"); | ||||
[email protected] | c405290f | 2011-01-08 02:04:59 | [diff] [blame] | 20 | set_homepage(GURL(net::FilePathToFileURL(test_file)).spec()); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 21 | } |
22 | }; | ||||
23 | |||||
[email protected] | dba2510 | 2011-06-12 21:01:58 | [diff] [blame] | 24 | // Flakily fails under Valgrind, see http://crbug.com/85863. |
25 | #if defined(OS_MACOSX) | ||||
26 | #define MAYBE_Crash FLAKY_Crash | ||||
27 | #else | ||||
28 | #define MAYBE_Crash Crash | ||||
29 | #endif // defined(OS_MACOSX) | ||||
30 | TEST_F(GoogleTest, MAYBE_Crash) { | ||||
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 31 | std::wstring page_title = L"Google"; |
32 | |||||
33 | // Make sure the navigation succeeded. | ||||
34 | EXPECT_EQ(page_title, GetActiveTabTitle()); | ||||
35 | |||||
36 | // UITest will check if this crashed. | ||||
37 | } | ||||
38 | |||||
39 | class ColumnLayout : public UITest { | ||||
40 | protected: | ||||
41 | ColumnLayout() : UITest() { | ||||
[email protected] | 95edc39 | 2010-07-30 22:00:38 | [diff] [blame] | 42 | FilePath test_file = test_data_directory_.AppendASCII("columns.html"); |
[email protected] | c405290f | 2011-01-08 02:04:59 | [diff] [blame] | 43 | set_homepage(GURL(net::FilePathToFileURL(test_file)).spec()); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 44 | } |
45 | }; | ||||
46 | |||||
[email protected] | dba2510 | 2011-06-12 21:01:58 | [diff] [blame] | 47 | // Flakily fails under Valgrind, see http://crbug.com/85863. |
48 | TEST_F(ColumnLayout, MAYBE_Crash) { | ||||
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 49 | std::wstring page_title = L"Column test"; |
50 | |||||
51 | // Make sure the navigation succeeded. | ||||
52 | EXPECT_EQ(page_title, GetActiveTabTitle()); | ||||
53 | |||||
[email protected] | 28de7d94 | 2010-02-23 01:43:04 | [diff] [blame] | 54 | // UITest will check if this crashed. |
55 | } |