summaryrefslogtreecommitdiffstats
path: root/chrome_frame/test/external_sites_test.cc
blob: d92d52ea5f475f3b3f5686eb80dab082df04ecf9 (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
37
38
39
40
41
42
43
44
45
46
47
48
49
// Copyright (c) 2012 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 <string>

#include "chrome_frame/test/chrome_frame_test_utils.h"
#include "chrome_frame/test/mock_ie_event_sink_actions.h"
#include "chrome_frame/test/mock_ie_event_sink_test.h"

using testing::_;
using testing::StrEq;

namespace chrome_frame_test {

// Test fixture for compatibility/reliability tests.
class ChromeFrameSitesTest
    : public MockIEEventSinkTest,
      public testing::TestWithParam<std::wstring> {
 public:
  ChromeFrameSitesTest() {}

  virtual void SetUp() {
    // Permit navigation in both IE and CF.
    ie_mock_.ExpectAnyNavigations();
  }
};

INSTANTIATE_TEST_CASE_P(CF, ChromeFrameSitesTest,
                        testing::Values(L"http://www.meebo.com/",
                                        L"http://www.vimeo.com/",
                                        L"http://wordpress.com/",
                                        L"https://github.com/"));

// Test for navigating to a site that has a CF metatag.
TEST_P(ChromeFrameSitesTest, LoadSite) {
  // Print name of site for debugging purposes.
  std::wcout << L"Navigating to site: " << GetParam() << std::endl;

  // Verify navigation to the url passed in as parameter.
  EXPECT_CALL(ie_mock_, OnLoad(IN_CF, StrEq(GetParam())))
      .WillOnce(testing::DoAll(
          VerifyAddressBarUrl(&ie_mock_),
          CloseBrowserMock(&ie_mock_)));

  LaunchIENavigateAndLoop(GetParam(), kChromeFrameLongNavigationTimeout * 2);
}

}  // namespace chrome_frame_test