Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(332)

Side by Side Diff: chrome/browser/history/multipart_uitest.cc

Issue 3034038: GTTF: Move more test server code from net/url_request/url_request_unittest.h (Closed)
Patch Set: hopefully final Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/test/ui/ui_test.h" 5 #include "chrome/test/ui/ui_test.h"
6 6
7 #include "app/sql/connection.h" 7 #include "app/sql/connection.h"
8 #include "app/sql/statement.h" 8 #include "app/sql/statement.h"
9 #include "base/file_util.h"
9 #include "chrome/test/automation/tab_proxy.h" 10 #include "chrome/test/automation/tab_proxy.h"
10 #include "chrome/test/automation/browser_proxy.h" 11 #include "chrome/test/automation/browser_proxy.h"
11 #include "net/url_request/url_request_unittest.h" 12 #include "net/test/test_server.h"
12 13
13 namespace { 14 namespace {
14 15
15 class MultipartResponseUITest : public UITest { 16 class MultipartResponseUITest : public UITest {
16 }; 17 };
17 18
18 // http://crbug.com/50060 19 // http://crbug.com/50060
19 #if defined(OS_MACOSX) 20 #if defined(OS_MACOSX)
20 #define MAYBE_SingleVisit DISABLED_SingleVisit 21 #define MAYBE_SingleVisit DISABLED_SingleVisit
21 #else 22 #else
22 #define MAYBE_SingleVisit SingleVisit 23 #define MAYBE_SingleVisit SingleVisit
23 #endif 24 #endif
24 25
25 #if defined(NDEBUG) 26 #if defined(NDEBUG)
26 // http://code.google.com/p/chromium/issues/detail?id=37746 27 // http://code.google.com/p/chromium/issues/detail?id=37746
27 // Running this test only for release builds as it fails in debug test 28 // Running this test only for release builds as it fails in debug test
28 // runs 29 // runs
29 TEST_F(MultipartResponseUITest, MAYBE_SingleVisit) { 30 TEST_F(MultipartResponseUITest, MAYBE_SingleVisit) {
30 // Make sure that visiting a multipart/x-mixed-replace site only 31 // Make sure that visiting a multipart/x-mixed-replace site only
31 // creates one entry in the visits table. 32 // creates one entry in the visits table.
32 const wchar_t kDocRoot[] = L"chrome/test/data"; 33 const wchar_t kDocRoot[] = L"chrome/test/data";
33 scoped_refptr<HTTPTestServer> server = 34 scoped_refptr<net::HTTPTestServer> server =
34 HTTPTestServer::CreateServer(kDocRoot); 35 net::HTTPTestServer::CreateServer(kDocRoot);
35 ASSERT_TRUE(NULL != server.get()); 36 ASSERT_TRUE(NULL != server.get());
36 37
37 scoped_refptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0)); 38 scoped_refptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0));
38 ASSERT_TRUE(browser_proxy.get()); 39 ASSERT_TRUE(browser_proxy.get());
39 scoped_refptr<TabProxy> tab_proxy(browser_proxy->GetActiveTab()); 40 scoped_refptr<TabProxy> tab_proxy(browser_proxy->GetActiveTab());
40 ASSERT_TRUE(tab_proxy.get()); 41 ASSERT_TRUE(tab_proxy.get());
41 NavigateToURL(server->TestServerPage("multipart")); 42 NavigateToURL(server->TestServerPage("multipart"));
42 std::wstring title; 43 std::wstring title;
43 EXPECT_TRUE(tab_proxy->GetTabTitle(&title)); 44 EXPECT_TRUE(tab_proxy->GetTabTitle(&title));
44 EXPECT_EQ(L"page 9", title); 45 EXPECT_EQ(L"page 9", title);
(...skipping 14 matching lines...) Expand all
59 sql::Statement statement(db.GetUniqueStatement(query.c_str())); 60 sql::Statement statement(db.GetUniqueStatement(query.c_str()));
60 EXPECT_TRUE(statement); 61 EXPECT_TRUE(statement);
61 EXPECT_TRUE(statement.Step()); 62 EXPECT_TRUE(statement.Step());
62 EXPECT_EQ(1, statement.ColumnInt(0)); 63 EXPECT_EQ(1, statement.ColumnInt(0));
63 } 64 }
64 db.Close(); 65 db.Close();
65 } 66 }
66 #endif 67 #endif
67 68
68 } // namespace 69 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/gtk/bookmark_bar_gtk_interactive_uitest.cc ('k') | chrome/browser/history/redirect_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698