blob: 2a54b28493414e0346baccddcbaa5ddd3ac26a46 (
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
|
// 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 "chrome/test/automation/tab_proxy.h"
#include "chrome/test/ui/ui_test.h"
#include "googleurl/src/gurl.h"
#include "net/test/test_server.h"
#include "testing/gtest/include/gtest/gtest.h"
class LoadTimingObserverUITest : public UITest {
public:
LoadTimingObserverUITest()
: http_server_(net::TestServer::TYPE_HTTP,
net::TestServer::kLocalhost,
FilePath()) {
dom_automation_enabled_ = true;
}
protected:
net::TestServer http_server_;
};
// http://crbug.com/102030
// http://crbug.com/114390
TEST_F(LoadTimingObserverUITest, DISABLED_CacheHitAfterRedirect) {
ASSERT_TRUE(http_server_.Start());
GURL cached_page = http_server_.GetURL("cachetime");
std::string redirect = "server-redirect?" + cached_page.spec();
NavigateToURL(cached_page);
NavigateToURL(http_server_.GetURL(redirect));
scoped_refptr<TabProxy> tab_proxy = GetActiveTab();
int response_start = 0;
int response_end = 0;
ASSERT_TRUE(tab_proxy->ExecuteAndExtractInt(
L"", L"window.domAutomationController.send("
L"window.performance.timing.responseStart - "
L"window.performance.timing.navigationStart)", &response_start));
ASSERT_TRUE(tab_proxy->ExecuteAndExtractInt(
L"", L"window.domAutomationController.send("
L"window.performance.timing.responseEnd - "
L"window.performance.timing.navigationStart)", &response_end));
EXPECT_LE(response_start, response_end);
}
|