| 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 "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "chrome/test/automation/tab_proxy.h" | 10 #include "chrome/test/automation/tab_proxy.h" |
| 11 #include "chrome/test/automation/browser_proxy.h" | 11 #include "chrome/test/automation/browser_proxy.h" |
| 12 #include "net/test/test_server.h" | 12 #include "net/test/test_server.h" |
| 13 | 13 |
| 14 namespace { | 14 namespace { |
| 15 | 15 |
| 16 class MultipartResponseUITest : public UITest { | 16 class MultipartResponseUITest : public UITest { |
| 17 }; | 17 }; |
| 18 | 18 |
| 19 // http://crbug.com/50060 | |
| 20 #if defined(OS_MACOSX) | |
| 21 #define MAYBE_SingleVisit DISABLED_SingleVisit | |
| 22 #else | |
| 23 #define MAYBE_SingleVisit SingleVisit | |
| 24 #endif | |
| 25 | |
| 26 #if defined(NDEBUG) | 19 #if defined(NDEBUG) |
| 27 // http://code.google.com/p/chromium/issues/detail?id=37746 | 20 // http://code.google.com/p/chromium/issues/detail?id=37746 |
| 28 // Running this test only for release builds as it fails in debug test | 21 // Running this test only for release builds as it fails in debug test |
| 29 // runs | 22 // runs |
| 30 TEST_F(MultipartResponseUITest, MAYBE_SingleVisit) { | 23 TEST_F(MultipartResponseUITest, SingleVisit) { |
| 31 // Make sure that visiting a multipart/x-mixed-replace site only | 24 // Make sure that visiting a multipart/x-mixed-replace site only |
| 32 // creates one entry in the visits table. | 25 // creates one entry in the visits table. |
| 33 net::TestServer test_server(net::TestServer::TYPE_HTTP, | 26 net::TestServer test_server(net::TestServer::TYPE_HTTP, |
| 34 FilePath(FILE_PATH_LITERAL("chrome/test/data"))); | 27 FilePath(FILE_PATH_LITERAL("chrome/test/data"))); |
| 35 ASSERT_TRUE(test_server.Start()); | 28 ASSERT_TRUE(test_server.Start()); |
| 36 | 29 |
| 37 scoped_refptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0)); | 30 scoped_refptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0)); |
| 38 ASSERT_TRUE(browser_proxy.get()); | 31 ASSERT_TRUE(browser_proxy.get()); |
| 39 scoped_refptr<TabProxy> tab_proxy(browser_proxy->GetActiveTab()); | 32 scoped_refptr<TabProxy> tab_proxy(browser_proxy->GetActiveTab()); |
| 40 ASSERT_TRUE(tab_proxy.get()); | 33 ASSERT_TRUE(tab_proxy.get()); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 60 sql::Statement statement(db.GetUniqueStatement(query.c_str())); | 53 sql::Statement statement(db.GetUniqueStatement(query.c_str())); |
| 61 EXPECT_TRUE(statement); | 54 EXPECT_TRUE(statement); |
| 62 EXPECT_TRUE(statement.Step()); | 55 EXPECT_TRUE(statement.Step()); |
| 63 EXPECT_EQ(1, statement.ColumnInt(0)); | 56 EXPECT_EQ(1, statement.ColumnInt(0)); |
| 64 } | 57 } |
| 65 db.Close(); | 58 db.Close(); |
| 66 } | 59 } |
| 67 #endif | 60 #endif |
| 68 | 61 |
| 69 } // namespace | 62 } // namespace |
| OLD | NEW |