| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/base/ui_test_utils.h" | 5 #include "chrome/test/base/ui_test_utils.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 | 391 |
| 392 void GetCookies(const GURL& url, | 392 void GetCookies(const GURL& url, |
| 393 WebContents* contents, | 393 WebContents* contents, |
| 394 int* value_size, | 394 int* value_size, |
| 395 std::string* value) { | 395 std::string* value) { |
| 396 *value_size = -1; | 396 *value_size = -1; |
| 397 if (url.is_valid() && contents) { | 397 if (url.is_valid() && contents) { |
| 398 scoped_refptr<net::URLRequestContextGetter> context_getter = | 398 scoped_refptr<net::URLRequestContextGetter> context_getter = |
| 399 contents->GetRenderProcessHost()->GetStoragePartition()-> | 399 contents->GetRenderProcessHost()->GetStoragePartition()-> |
| 400 GetURLRequestContext(); | 400 GetURLRequestContext(); |
| 401 base::WaitableEvent event(true /* manual reset */, | 401 base::WaitableEvent event(base::WaitableEvent::ResetPolicy::MANUAL, |
| 402 false /* not initially signaled */); | 402 base::WaitableEvent::InitialState::NOT_SIGNALED); |
| 403 CHECK(content::BrowserThread::PostTask( | 403 CHECK(content::BrowserThread::PostTask( |
| 404 content::BrowserThread::IO, FROM_HERE, | 404 content::BrowserThread::IO, FROM_HERE, |
| 405 base::Bind(&GetCookiesOnIOThread, url, context_getter, &event, value))); | 405 base::Bind(&GetCookiesOnIOThread, url, context_getter, &event, value))); |
| 406 event.Wait(); | 406 event.Wait(); |
| 407 | 407 |
| 408 *value_size = static_cast<int>(value->size()); | 408 *value_size = static_cast<int>(value->size()); |
| 409 } | 409 } |
| 410 } | 410 } |
| 411 | 411 |
| 412 WindowedTabAddedNotificationObserver::WindowedTabAddedNotificationObserver( | 412 WindowedTabAddedNotificationObserver::WindowedTabAddedNotificationObserver( |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 new content::MessageLoopRunner; | 530 new content::MessageLoopRunner; |
| 531 WaitHistoryLoadedObserver observer(runner.get()); | 531 WaitHistoryLoadedObserver observer(runner.get()); |
| 532 ScopedObserver<history::HistoryService, history::HistoryServiceObserver> | 532 ScopedObserver<history::HistoryService, history::HistoryServiceObserver> |
| 533 scoped_observer(&observer); | 533 scoped_observer(&observer); |
| 534 scoped_observer.Add(history_service); | 534 scoped_observer.Add(history_service); |
| 535 runner->Run(); | 535 runner->Run(); |
| 536 } | 536 } |
| 537 } | 537 } |
| 538 | 538 |
| 539 } // namespace ui_test_utils | 539 } // namespace ui_test_utils |
| OLD | NEW |