OLD | NEW |
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 "chrome/test/automation/tab_proxy.h" | 9 #include "chrome/test/automation/tab_proxy.h" |
10 #include "chrome/test/automation/browser_proxy.h" | 10 #include "chrome/test/automation/browser_proxy.h" |
11 #include "net/url_request/url_request_unittest.h" | 11 #include "net/url_request/url_request_unittest.h" |
12 | 12 |
13 namespace { | 13 namespace { |
14 | 14 |
15 class MultipartResponseUITest : public UITest { | 15 class MultipartResponseUITest : public UITest { |
16 }; | 16 }; |
17 | 17 |
18 #if defined(NDEBUG) | 18 #if defined(NDEBUG) |
19 // http://code.google.com/p/chromium/issues/detail?id=37746 | 19 // http://code.google.com/p/chromium/issues/detail?id=37746 |
20 // Running this test only for release builds as it fails in debug test | 20 // Running this test only for release builds as it fails in debug test |
21 // runs | 21 // runs |
22 TEST_F(MultipartResponseUITest, SingleVisit) { | 22 TEST_F(MultipartResponseUITest, SingleVisit) { |
23 // Make sure that visiting a multipart/x-mixed-replace site only | 23 // Make sure that visiting a multipart/x-mixed-replace site only |
24 // creates one entry in the visits table. | 24 // creates one entry in the visits table. |
25 const wchar_t kDocRoot[] = L"chrome/test/data"; | 25 const wchar_t kDocRoot[] = L"chrome/test/data"; |
26 scoped_refptr<HTTPTestServer> server = | 26 scoped_refptr<HTTPTestServer> server = |
27 HTTPTestServer::CreateServer(kDocRoot, NULL); | 27 HTTPTestServer::CreateServer(kDocRoot); |
28 ASSERT_TRUE(NULL != server.get()); | 28 ASSERT_TRUE(NULL != server.get()); |
29 | 29 |
30 scoped_refptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0)); | 30 scoped_refptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0)); |
31 ASSERT_TRUE(browser_proxy.get()); | 31 ASSERT_TRUE(browser_proxy.get()); |
32 scoped_refptr<TabProxy> tab_proxy(browser_proxy->GetActiveTab()); | 32 scoped_refptr<TabProxy> tab_proxy(browser_proxy->GetActiveTab()); |
33 ASSERT_TRUE(tab_proxy.get()); | 33 ASSERT_TRUE(tab_proxy.get()); |
34 NavigateToURL(server->TestServerPage("multipart")); | 34 NavigateToURL(server->TestServerPage("multipart")); |
35 std::wstring title; | 35 std::wstring title; |
36 EXPECT_TRUE(tab_proxy->GetTabTitle(&title)); | 36 EXPECT_TRUE(tab_proxy->GetTabTitle(&title)); |
37 EXPECT_EQ(L"page 9", title); | 37 EXPECT_EQ(L"page 9", title); |
(...skipping 14 matching lines...) Expand all Loading... |
52 sql::Statement statement(db.GetUniqueStatement(query.c_str())); | 52 sql::Statement statement(db.GetUniqueStatement(query.c_str())); |
53 EXPECT_TRUE(statement); | 53 EXPECT_TRUE(statement); |
54 EXPECT_TRUE(statement.Step()); | 54 EXPECT_TRUE(statement.Step()); |
55 EXPECT_EQ(1, statement.ColumnInt(0)); | 55 EXPECT_EQ(1, statement.ColumnInt(0)); |
56 } | 56 } |
57 db.Close(); | 57 db.Close(); |
58 } | 58 } |
59 #endif | 59 #endif |
60 | 60 |
61 } // namespace | 61 } // namespace |
OLD | NEW |