[email protected] | d2e78706 | 2011-02-05 06:04:49 | [diff] [blame] | 1 | // Copyright (c) 2011 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 | #include "base/basictypes.h" | ||||
[email protected] | 72cbd32 | 2009-04-07 10:17:12 | [diff] [blame] | 6 | #include "base/file_path.h" |
[email protected] | 8f165b8 | 2009-04-08 18:18:25 | [diff] [blame] | 7 | #include "build/build_config.h" |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 8 | #include "chrome/test/ui/ui_test.h" |
9 | #include "net/base/net_util.h" | ||||
10 | |||||
11 | class IFrameTest : public UITest { | ||||
12 | protected: | ||||
[email protected] | 72cbd32 | 2009-04-07 10:17:12 | [diff] [blame] | 13 | void NavigateAndVerifyTitle(const char* url, const wchar_t* page_title) { |
[email protected] | 4b68e0d | 2009-05-02 00:56:57 | [diff] [blame] | 14 | FilePath test_file(test_data_directory_); |
[email protected] | 72cbd32 | 2009-04-07 10:17:12 | [diff] [blame] | 15 | test_file = test_file.AppendASCII(url); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 16 | |
[email protected] | 8ac1a75 | 2008-07-31 19:40:37 | [diff] [blame] | 17 | NavigateToURL(net::FilePathToFileURL(test_file)); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 18 | EXPECT_EQ(std::wstring(page_title), GetActiveTabTitle()); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 19 | } |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 20 | }; |
21 | |||||
22 | TEST_F(IFrameTest, Crash) { | ||||
[email protected] | 72cbd32 | 2009-04-07 10:17:12 | [diff] [blame] | 23 | NavigateAndVerifyTitle("iframe.html", L"iframe test"); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 24 | } |
25 | |||||
[email protected] | f531a3e | 2011-10-14 00:05:07 | [diff] [blame] | 26 | TEST_F(IFrameTest, InEmptyFrame) { |
[email protected] | 72cbd32 | 2009-04-07 10:17:12 | [diff] [blame] | 27 | NavigateAndVerifyTitle("iframe_in_empty_frame.html", L"iframe test"); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 28 | } |