summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
authorericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-30 00:56:11 +0000
committerericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-30 00:56:11 +0000
commita1373e7e48fe39b488f8888f5018bf2e624a0268 (patch)
treec74c8e6f35cae4b61198a2945f1a7bee3f1186a6 /chrome/common
parent28c3a7197b1162723019732c04fc3acab2a20ea2 (diff)
downloadchromium_src-a1373e7e48fe39b488f8888f5018bf2e624a0268.zip
chromium_src-a1373e7e48fe39b488f8888f5018bf2e624a0268.tar.gz
chromium_src-a1373e7e48fe39b488f8888f5018bf2e624a0268.tar.bz2
Remove cache_uittest.cc.
This test is flaky, and doesn't add anything on top of what the net/http/http_network_transaciton_unittest.cc or net/http/http_cache_unittest.cc unit-tests already check for. BUG=6491 Review URL: http://codereview.chromium.org/151046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19572 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/net/cache_uitest.cc179
1 files changed, 0 insertions, 179 deletions
diff --git a/chrome/common/net/cache_uitest.cc b/chrome/common/net/cache_uitest.cc
deleted file mode 100644
index 1754d5a..0000000
--- a/chrome/common/net/cache_uitest.cc
+++ /dev/null
@@ -1,179 +0,0 @@
-// 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 <string>
-
-#include "base/platform_thread.h"
-#include "base/string_util.h"
-#include "chrome/test/ui/ui_test.h"
-#include "chrome/test/automation/automation_proxy.h"
-#include "chrome/test/automation/browser_proxy.h"
-#include "chrome/test/automation/tab_proxy.h"
-#include "net/url_request/url_request_unittest.h"
-
-// The CacheTest class extends the UITest class and provides functions to
-// get a new tab and to run the tests on a particular path
-//
-// Typical usage:
-//
-// 1. Provide this class as the TestCase for TEST_F macro
-// 2. Then run the cache test on a specific path using the function
-// RunCacheTest
-//
-// For example:
-//
-// TEST_F(CacheTest, NoCacheMaxAge) {
-// RunCacheTest(L"nocachetime/maxage", false, false);
-// }
-//
-// Note that delays used in running the test is initialized to defaults
-class CacheTest : public UITest {
- protected:
-
- // Runs the cache test for the specified path.
- // Can specify the test to check if a new tab is loaded from the cache
- // and also if a delayed reload is required. A true value passed to the
- // third parameter causes a delayed reload of the path in a new tab.
- // The amount of delay is set by a class constant.
- void RunCacheTest(const std::wstring &url,
- bool expect_new_tab_cached,
- bool expect_delayed_reload);
-
- private:
- // Class constants
- static const int kWaitForCacheUpdateMsec = 1000;
- static const int kCacheWaitMultiplier = 4; // Used to increase delay
-
- // Appends a new tab to the test chrome window and loads the specified
- // URL. The new tab will try to get the URL from the cache before requesting
- // the server for it.
- void GetNewTab(AutomationProxy* automationProxy, const GURL& tab_url);
-};
-
-// Runs the cache test for the specified path.
-void CacheTest::RunCacheTest(const std::wstring &url,
- bool expect_new_tab_cached,
- bool expect_delayed_reload) {
- scoped_refptr<HTTPTestServer> server =
- HTTPTestServer::CreateServer(L"chrome/test/data", NULL);
- ASSERT_TRUE(NULL != server.get());
- GURL test_page(server->TestServerPageW(url));
-
- NavigateToURL(test_page);
- std::wstring original_time = GetActiveTabTitle();
-
- PlatformThread::Sleep(kWaitForCacheUpdateMsec);
-
- GetNewTab(automation(), test_page);
- std::wstring revisit_time = GetActiveTabTitle();
-
- if (expect_new_tab_cached) {
- EXPECT_EQ(original_time, revisit_time);
- }else {
- EXPECT_NE(original_time, revisit_time);
- }
-
- PlatformThread::Sleep(kWaitForCacheUpdateMsec);
-
- // Force reload, overriding the caching behavior
- NavigateToURL(test_page);
- std::wstring reload_time = GetActiveTabTitle();
-
- EXPECT_NE(revisit_time, reload_time);
-
- if (expect_delayed_reload) {
- PlatformThread::Sleep(kWaitForCacheUpdateMsec * kCacheWaitMultiplier);
-
- GetNewTab(automation(), test_page);
- revisit_time = GetActiveTabTitle();
-
- EXPECT_NE(reload_time, revisit_time);
- }
-}
-
-// Appends a new tab to the test chrome window and loads the specified URL.
-void CacheTest::GetNewTab(AutomationProxy* automationProxy,
- const GURL& tab_url) {
- scoped_refptr<BrowserProxy> window_proxy(automationProxy->GetBrowserWindow(0));
- ASSERT_TRUE(window_proxy.get());
- ASSERT_TRUE(window_proxy->AppendTab(tab_url));
-}
-
-// Tests that a cached copy of the page is not used when max-age=0 headers
-// are specified.
-TEST_F(CacheTest, NoCacheMaxAge) {
- RunCacheTest(L"nocachetime/maxage", false, false);
-}
-
-// Tests that a cached copy of the page is not used when no-cache header
-// is specified.
-TEST_F(CacheTest, NoCache) {
- RunCacheTest(L"nocachetime", false, false);
-}
-
-// Tests that a cached copy of a page is used when its headers specify
-// that it should be cached for 60 seconds.
-TEST_F(CacheTest, Cache) {
- RunCacheTest(L"cachetime", true, false);
-}
-
-// Tests that a cached copy of the page is used when expires header
-// specifies that the page has not yet expired.
-TEST_F(CacheTest, Expires) {
- RunCacheTest(L"cache/expires", true, false);
-}
-
-// Tests that a cached copy of the page is used when proxy-revalidate header
-// is specified and the page has not yet expired.
-TEST_F(CacheTest, ProxyRevalidate) {
- RunCacheTest(L"cache/proxy-revalidate", true, false);
-}
-
-// Tests that a cached copy of the page is used when private header
-// is specified and the page has not yet expired.
-TEST_F(CacheTest, Private) {
- RunCacheTest(L"cache/private", true, true);
-}
-
-// Tests that a cached copy of the page is used when public header
-// is specified and the page has not yet expired.
-TEST_F(CacheTest, Public) {
- RunCacheTest(L"cache/public", true, true);
-}
-
-// Tests that a cached copy of the page is not used when s-maxage header
-// is specified.
-TEST_F(CacheTest, SMaxAge) {
- RunCacheTest(L"cache/s-maxage", false, false);
-}
-
-// Tests that a cached copy of the page is not used when must-revalidate header
-// is specified.
-TEST_F(CacheTest, MustRevalidate) {
- RunCacheTest(L"cache/must-revalidate", false, false);
-}
-
-// Tests that a cached copy of the page is not used when must-revalidate header
-// is specified, even though the page has not yet expired.
-TEST_F(CacheTest, MustRevalidateMaxAge) {
- RunCacheTest(L"cache/must-revalidate/max-age", false, false);
-}
-
-// Tests that a cached copy of the page is not used when no-store header
-// is specified.
-TEST_F(CacheTest, NoStore) {
- RunCacheTest(L"cache/no-store", false, false);
-}
-
-// Tests that a cached copy of the page is not used when no-store header
-// is specified, even though the page has not yet expired.
-TEST_F(CacheTest, NoStoreMaxAge) {
- RunCacheTest(L"cache/no-store/max-age", false, false);
-}
-
-// Tests that a cached copy of the page is not transformed when no-transform
-// header is specified.
-TEST_F(CacheTest, NoTransform) {
- RunCacheTest(L"cache/no-transform", false, false);
-}