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/browser/sync/test/integration/sync_test.h" | 5 #include "chrome/browser/sync/test/integration/sync_test.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
667 EnableNotificationsImpl(); | 667 EnableNotificationsImpl(); |
668 notifications_enabled_ = true; | 668 notifications_enabled_ = true; |
669 } | 669 } |
670 | 670 |
671 void SyncTest::TriggerNotification(syncer::ModelTypeSet changed_types) { | 671 void SyncTest::TriggerNotification(syncer::ModelTypeSet changed_types) { |
672 ASSERT_TRUE(ServerSupportsNotificationControl()); | 672 ASSERT_TRUE(ServerSupportsNotificationControl()); |
673 const std::string& data = | 673 const std::string& data = |
674 syncer::P2PNotificationData( | 674 syncer::P2PNotificationData( |
675 "from_server", | 675 "from_server", |
676 syncer::NOTIFY_ALL, | 676 syncer::NOTIFY_ALL, |
677 syncer::ObjectIdSetToStateMap( | 677 syncer::ObjectIdSetToInvalidationMap( |
678 syncer::ModelTypeSetToObjectIdSet(changed_types), ""), | 678 syncer::ModelTypeSetToObjectIdSet(changed_types), std::string()), |
679 syncer::REMOTE_INVALIDATION).ToString(); | 679 syncer::REMOTE_INVALIDATION).ToString(); |
680 const std::string& path = | 680 const std::string& path = |
681 std::string("chromiumsync/sendnotification?channel=") + | 681 std::string("chromiumsync/sendnotification?channel=") + |
682 syncer::kSyncP2PNotificationChannel + "&data=" + data; | 682 syncer::kSyncP2PNotificationChannel + "&data=" + data; |
683 ui_test_utils::NavigateToURL(browser(), sync_server_.GetURL(path)); | 683 ui_test_utils::NavigateToURL(browser(), sync_server_.GetURL(path)); |
684 ASSERT_EQ("Notification sent", | 684 ASSERT_EQ("Notification sent", |
685 UTF16ToASCII(chrome::GetActiveWebContents(browser())->GetTitle())); | 685 UTF16ToASCII(chrome::GetActiveWebContents(browser())->GetTitle())); |
686 } | 686 } |
687 | 687 |
688 bool SyncTest::ServerSupportsErrorTriggering() const { | 688 bool SyncTest::ServerSupportsErrorTriggering() const { |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
818 | 818 |
819 void SyncTest::SetProxyConfig(net::URLRequestContextGetter* context_getter, | 819 void SyncTest::SetProxyConfig(net::URLRequestContextGetter* context_getter, |
820 const net::ProxyConfig& proxy_config) { | 820 const net::ProxyConfig& proxy_config) { |
821 base::WaitableEvent done(false, false); | 821 base::WaitableEvent done(false, false); |
822 BrowserThread::PostTask( | 822 BrowserThread::PostTask( |
823 BrowserThread::IO, FROM_HERE, | 823 BrowserThread::IO, FROM_HERE, |
824 base::Bind(&SetProxyConfigCallback, &done, | 824 base::Bind(&SetProxyConfigCallback, &done, |
825 make_scoped_refptr(context_getter), proxy_config)); | 825 make_scoped_refptr(context_getter), proxy_config)); |
826 done.Wait(); | 826 done.Wait(); |
827 } | 827 } |
OLD | NEW |