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" |
(...skipping 24 matching lines...) Expand all Loading... |
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); |
38 CloseBrowserAndServer(); | 38 CloseBrowserAndServer(); |
39 | 39 |
40 // The browser has shutdown now. Check the contents of the history | 40 // The browser has shutdown now. Check the contents of the history |
41 // table. We should have only one visit for the URL even though it | 41 // table. We should have only one visit for the URL even though it |
42 // had 10 parts. | 42 // had 10 parts. |
43 sql::Connection db; | 43 sql::Connection db; |
44 FilePath history = | 44 FilePath history = |
45 user_data_dir_.AppendASCII("Default").AppendASCII("History"); | 45 user_data_dir().AppendASCII("Default").AppendASCII("History"); |
46 ASSERT_TRUE(file_util::PathExists(history)); | 46 ASSERT_TRUE(file_util::PathExists(history)); |
47 ASSERT_TRUE(db.Open(history)); | 47 ASSERT_TRUE(db.Open(history)); |
48 std::string query( | 48 std::string query( |
49 "SELECT COUNT(1) FROM visits, urls WHERE visits.url = urls.id" | 49 "SELECT COUNT(1) FROM visits, urls WHERE visits.url = urls.id" |
50 " AND urls.url LIKE 'http://localhost:%/multipart'"); | 50 " AND urls.url LIKE 'http://localhost:%/multipart'"); |
51 { | 51 { |
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 |