diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-18 01:09:54 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-18 01:09:54 +0000 |
commit | 3e3b20d97d5910c13041bcfc68d16ac7b8da130c (patch) | |
tree | 4eae3703bb49ab7fdffc01e7a5356b1ee791acc3 /chrome/renderer | |
parent | 7613faaea65b29a00c8bba44b440227fe7b0cade (diff) | |
download | chromium_src-3e3b20d97d5910c13041bcfc68d16ac7b8da130c.zip chromium_src-3e3b20d97d5910c13041bcfc68d16ac7b8da130c.tar.gz chromium_src-3e3b20d97d5910c13041bcfc68d16ac7b8da130c.tar.bz2 |
Convert the load times ui_test to a browser_test.
BUG=121574
Review URL: https://chromiumcodereview.appspot.com/10083031
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132716 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r-- | chrome/renderer/loadtimes_extension_bindings_uitest.cc | 75 |
1 files changed, 0 insertions, 75 deletions
diff --git a/chrome/renderer/loadtimes_extension_bindings_uitest.cc b/chrome/renderer/loadtimes_extension_bindings_uitest.cc deleted file mode 100644 index 84a7e67..0000000 --- a/chrome/renderer/loadtimes_extension_bindings_uitest.cc +++ /dev/null @@ -1,75 +0,0 @@ -// 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 LoadtimesExtensionBindingsUITest : public UITest { - public: - LoadtimesExtensionBindingsUITest() - : http_server_(net::TestServer::TYPE_HTTP, - net::TestServer::kLocalhost, - FilePath()) { - dom_automation_enabled_ = true; - } - - void CompareBeforeAndAfter(TabProxy* tab_proxy) { - // TODO(simonjam): There's a race on whether or not first paint is populated - // before we read them. We ought to test that too. Until the race is fixed, - // zero it out so the test is stable. - ASSERT_TRUE(tab_proxy->ExecuteJavaScript( - "window.before.firstPaintAfterLoadTime = 0;" - "window.before.firstPaintTime = 0;" - "window.after.firstPaintAfterLoadTime = 0;" - "window.after.firstPaintTime = 0;")); - - std::wstring before; - std::wstring after; - ASSERT_TRUE(tab_proxy->ExecuteAndExtractString( - L"", L"window.domAutomationController.send(" - L"JSON.stringify(before))", &before)); - ASSERT_TRUE(tab_proxy->ExecuteAndExtractString( - L"", L"window.domAutomationController.send(" - L"JSON.stringify(after))", &after)); - EXPECT_EQ(before, after); - } - - protected: - net::TestServer http_server_; -}; - -TEST_F(LoadtimesExtensionBindingsUITest, - LoadTimesSameAfterClientInDocNavigation) { - ASSERT_TRUE(http_server_.Start()); - GURL plain_url = http_server_.GetURL("blank"); - NavigateToURL(plain_url); - scoped_refptr<TabProxy> tab_proxy = GetActiveTab(); - ASSERT_TRUE(tab_proxy.get()); - ASSERT_TRUE(tab_proxy->ExecuteJavaScript( - "window.before = window.chrome.loadTimes()")); - ASSERT_TRUE(tab_proxy->ExecuteJavaScript( - "window.location.href = window.location + \"#\"")); - ASSERT_TRUE(tab_proxy->ExecuteJavaScript( - "window.after = window.chrome.loadTimes()")); - CompareBeforeAndAfter(tab_proxy.get()); -} - -TEST_F(LoadtimesExtensionBindingsUITest, - LoadTimesSameAfterUserInDocNavigation) { - ASSERT_TRUE(http_server_.Start()); - GURL plain_url = http_server_.GetURL("blank"); - GURL hash_url(plain_url.spec() + "#"); - NavigateToURL(plain_url); - scoped_refptr<TabProxy> tab_proxy = GetActiveTab(); - ASSERT_TRUE(tab_proxy.get()); - ASSERT_TRUE(tab_proxy->ExecuteJavaScript( - "window.before = window.chrome.loadTimes()")); - NavigateToURL(hash_url); - ASSERT_TRUE(tab_proxy->ExecuteJavaScript( - "window.after = window.chrome.loadTimes()")); - CompareBeforeAndAfter(tab_proxy.get()); -} |