summaryrefslogtreecommitdiffstats
path: root/chrome/browser/iframe_uitest.cc
blob: 1c46b8853a39e867ea92e08d9fa792c903be2f9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "base/basictypes.h"
#include "base/file_util.h"
#include "chrome/test/ui/ui_test.h"
#include "net/base/net_util.h"

class IFrameTest : public UITest {
 protected:
  void NavigateAndVerifyTitle(const wchar_t* url, const wchar_t* page_title) {
    std::wstring test_file = test_data_directory_;
    file_util::AppendToPath(&test_file, url);

    NavigateToURL(net::FilePathToFileURL(test_file));
    Sleep(kWaitForActionMsec);  // The browser lazily updates the title.

    // Make sure the navigation succeeded.
    EXPECT_EQ(std::wstring(page_title), GetActiveTabTitle());

    // UITest will check if this crashed.
  }

};

TEST_F(IFrameTest, Crash) {
  NavigateAndVerifyTitle(L"iframe.html", L"iframe test");
}

// http://crbug.com/3035 : Triggers a DCHECK in web_contents.cc.  Need to
// investigate.
TEST_F(IFrameTest, DISABLED_InEmptyFrame) {
  NavigateAndVerifyTitle(L"iframe_in_empty_frame.html", L"iframe test");
}