OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/file_path.h" | 6 #include "base/file_path.h" |
7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
8 #include "base/test/thread_test_helper.h" | 8 #include "base/test/thread_test_helper.h" |
9 #include "chrome/browser/net/sqlite_persistent_cookie_store.h" | 9 #include "chrome/browser/net/sqlite_persistent_cookie_store.h" |
10 #include "chrome/common/chrome_constants.h" | 10 #include "chrome/common/chrome_constants.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 ASSERT_TRUE(thread_helper_->Run()); | 63 ASSERT_TRUE(thread_helper_->Run()); |
64 STLDeleteElements(&cookies); | 64 STLDeleteElements(&cookies); |
65 } | 65 } |
66 | 66 |
67 private: | 67 private: |
68 void LoadCookiesCallback( | 68 void LoadCookiesCallback( |
69 MessageLoop* to_notify, | 69 MessageLoop* to_notify, |
70 std::vector<net::CookieMonster::CanonicalCookie*>* cookies, | 70 std::vector<net::CookieMonster::CanonicalCookie*>* cookies, |
71 const std::vector<net::CookieMonster::CanonicalCookie*>& cookies_get) { | 71 const std::vector<net::CookieMonster::CanonicalCookie*>& cookies_get) { |
72 *cookies = cookies_get; | 72 *cookies = cookies_get; |
73 to_notify->PostTask(FROM_HERE, new MessageLoop::QuitTask()); | 73 to_notify->PostTask(FROM_HERE, MessageLoop::QuitClosure()); |
74 } | 74 } |
75 | 75 |
76 content::TestBrowserThread db_thread_; | 76 content::TestBrowserThread db_thread_; |
77 content::TestBrowserThread io_thread_; | 77 content::TestBrowserThread io_thread_; |
78 scoped_refptr<base::ThreadTestHelper> thread_helper_; | 78 scoped_refptr<base::ThreadTestHelper> thread_helper_; |
79 FilePath user_data_dir_; | 79 FilePath user_data_dir_; |
80 | 80 |
81 DISALLOW_COPY_AND_ASSIGN(FastShutdown); | 81 DISALLOW_COPY_AND_ASSIGN(FastShutdown); |
82 }; | 82 }; |
83 | 83 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 // cookie that's stored to disk. | 125 // cookie that's stored to disk. |
126 QuitBrowser(); | 126 QuitBrowser(); |
127 | 127 |
128 bool has_cookie = false; | 128 bool has_cookie = false; |
129 std::string cookie_value; | 129 std::string cookie_value; |
130 // Read the cookie and check that it has the expected value. | 130 // Read the cookie and check that it has the expected value. |
131 GetCookie(cookie, &has_cookie, &cookie_value); | 131 GetCookie(cookie, &has_cookie, &cookie_value); |
132 EXPECT_TRUE(has_cookie); | 132 EXPECT_TRUE(has_cookie); |
133 EXPECT_EQ("ohyeah", cookie_value); | 133 EXPECT_EQ("ohyeah", cookie_value); |
134 } | 134 } |
OLD | NEW |