blob: c68d577c958d3a3d0f6c27d8f1a7e5675b47498f [file] [log] [blame]
yoava1a508b42015-10-20 12:03:211// Copyright 2015 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 <stdlib.h>
6
7#include "content/public/test/browser_test_utils.h"
8#include "content/public/test/content_browser_test.h"
9#include "content/public/test/content_browser_test_utils.h"
10#include "content/public/test/test_navigation_observer.h"
11#include "content/shell/browser/shell.h"
12
13namespace content {
14
15class ResourceLoadingBrowserTest : public ContentBrowserTest {
16};
17
18const char kResourceLoadingNonMobilePage[] =
svaldez799d1592015-12-03 21:10:0819 "/resource_loading/resource_loading_non_mobile.html";
yoave746b1562015-10-27 12:19:2920
yoava1a508b42015-10-20 12:03:2121IN_PROC_BROWSER_TEST_F(ResourceLoadingBrowserTest,
22 ResourceLoadingAvoidDoubleDownloads) {
svaldez799d1592015-12-03 21:10:0823 ASSERT_TRUE(embedded_test_server()->Start());
24 GURL url = embedded_test_server()->GetURL(kResourceLoadingNonMobilePage);
yoava1a508b42015-10-20 12:03:2125 NavigateToURL(shell(), url);
26 int data = -1;
27 EXPECT_TRUE(ExecuteScriptAndExtractInt(shell()->web_contents(),
28 "getResourceNumber()", &data));
yoave746b1562015-10-27 12:19:2929 EXPECT_EQ(2, data);
yoava1a508b42015-10-20 12:03:2130}
31
32} // namespace content