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
3// found in the LICENSE file.
4
5#include <string>
6
7#include "chrome_frame/test/chrome_frame_test_utils.h"
8#include "chrome_frame/test/mock_ie_event_sink_actions.h"
9#include "chrome_frame/test/mock_ie_event_sink_test.h"
10
11using testing::_;
12using testing::StrEq;
13
14namespace chrome_frame_test {
15
16// Test fixture for compatibility/reliability tests.
17class ChromeFrameSitesTest
18    : public MockIEEventSinkTest,
19      public testing::TestWithParam<std::wstring> {
20 public:
21  ChromeFrameSitesTest() {}
22
23  virtual void SetUp() {
24    // Permit navigation in both IE and CF.
25    ie_mock_.ExpectAnyNavigations();
26  }
27};
28
29INSTANTIATE_TEST_CASE_P(CF, ChromeFrameSitesTest,
30                        testing::Values(L"http://www.meebo.com/",
31                                        L"http://www.vimeo.com/",
32                                        L"http://wordpress.com/",
33                                        L"https://github.com/"));
34
35// Test for navigating to a site that has a CF metatag.
36TEST_P(ChromeFrameSitesTest, LoadSite) {
37  // Print name of site for debugging purposes.
38  std::wcout << L"Navigating to site: " << GetParam() << std::endl;
39
40  // Verify navigation to the url passed in as parameter.
41  EXPECT_CALL(ie_mock_, OnLoad(IN_CF, StrEq(GetParam())))
42      .WillOnce(testing::DoAll(
43          VerifyAddressBarUrl(&ie_mock_),
44          CloseBrowserMock(&ie_mock_)));
45
46  LaunchIENavigateAndLoop(GetParam(), kChromeFrameLongNavigationTimeout * 2);
47}
48
49}  // namespace chrome_frame_test
50