Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 <set> | 7 #include <set> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "app/sql/connection.h" | 10 #include "app/sql/connection.h" |
| (...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 637 return static_cast<DictionaryValue*>(root_value.release()); | 637 return static_cast<DictionaryValue*>(root_value.release()); |
| 638 } | 638 } |
| 639 | 639 |
| 640 DictionaryValue* UITest::GetLocalState() { | 640 DictionaryValue* UITest::GetLocalState() { |
| 641 FilePath local_state_path; | 641 FilePath local_state_path; |
| 642 PathService::Get(chrome::FILE_LOCAL_STATE, &local_state_path); | 642 PathService::Get(chrome::FILE_LOCAL_STATE, &local_state_path); |
| 643 return LoadDictionaryValueFromPath(local_state_path); | 643 return LoadDictionaryValueFromPath(local_state_path); |
| 644 } | 644 } |
| 645 | 645 |
| 646 DictionaryValue* UITest::GetDefaultProfilePreferences() { | 646 DictionaryValue* UITest::GetDefaultProfilePreferences() { |
| 647 std::wstring path_wstring; | 647 FilePath path; |
| 648 PathService::Get(chrome::DIR_USER_DATA, &path_wstring); | 648 PathService::Get(chrome::DIR_USER_DATA, &path); |
| 649 file_util::AppendToPath(&path_wstring, chrome::kNotSignedInProfile); | 649 path = path.AppendASCII(WideToASCII(chrome::kNotSignedInProfile)); |
|
tony
2009/10/19 22:46:49
tears :(
| |
| 650 FilePath path(FilePath::FromWStringHack(path_wstring)); | |
| 651 return LoadDictionaryValueFromPath(path.Append(chrome::kPreferencesFilename)); | 650 return LoadDictionaryValueFromPath(path.Append(chrome::kPreferencesFilename)); |
| 652 } | 651 } |
| 653 | 652 |
| 654 int UITest::GetTabCount() { | 653 int UITest::GetTabCount() { |
| 655 scoped_refptr<BrowserProxy> first_window(automation()->GetBrowserWindow(0)); | 654 scoped_refptr<BrowserProxy> first_window(automation()->GetBrowserWindow(0)); |
| 656 if (!first_window.get()) | 655 if (!first_window.get()) |
| 657 return 0; | 656 return 0; |
| 658 | 657 |
| 659 int result = 0; | 658 int result = 0; |
| 660 EXPECT_TRUE(first_window->GetTabCount(&result)); | 659 EXPECT_TRUE(first_window->GetTabCount(&result)); |
| (...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1169 std::string yesterday_str = Int64ToString(yesterday.ToInternalValue()); | 1168 std::string yesterday_str = Int64ToString(yesterday.ToInternalValue()); |
| 1170 std::string query = StringPrintf( | 1169 std::string query = StringPrintf( |
| 1171 "UPDATE segment_usage " | 1170 "UPDATE segment_usage " |
| 1172 "SET time_slot = %s " | 1171 "SET time_slot = %s " |
| 1173 "WHERE id IN (SELECT id FROM segment_usage WHERE time_slot > 0);", | 1172 "WHERE id IN (SELECT id FROM segment_usage WHERE time_slot > 0);", |
| 1174 yesterday_str.c_str()); | 1173 yesterday_str.c_str()); |
| 1175 ASSERT_TRUE(db.Execute(query.c_str())); | 1174 ASSERT_TRUE(db.Execute(query.c_str())); |
| 1176 db.Close(); | 1175 db.Close(); |
| 1177 file_util::EvictFileFromSystemCache(history); | 1176 file_util::EvictFileFromSystemCache(history); |
| 1178 } | 1177 } |
| OLD | NEW |