| 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 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 669 EnableNotificationsImpl(); | 669 EnableNotificationsImpl(); |
| 670 notifications_enabled_ = true; | 670 notifications_enabled_ = true; |
| 671 } | 671 } |
| 672 | 672 |
| 673 void SyncTest::TriggerNotification(syncer::ModelTypeSet changed_types) { | 673 void SyncTest::TriggerNotification(syncer::ModelTypeSet changed_types) { |
| 674 ASSERT_TRUE(ServerSupportsNotificationControl()); | 674 ASSERT_TRUE(ServerSupportsNotificationControl()); |
| 675 const std::string& data = | 675 const std::string& data = |
| 676 syncer::P2PNotificationData( | 676 syncer::P2PNotificationData( |
| 677 "from_server", | 677 "from_server", |
| 678 syncer::NOTIFY_ALL, | 678 syncer::NOTIFY_ALL, |
| 679 syncer::ObjectIdSetToInvalidationMap( | 679 syncer::ObjectIdInvalidationMap::InvalidateAll( |
| 680 syncer::ModelTypeSetToObjectIdSet(changed_types), | 680 syncer::ModelTypeSetToObjectIdSet(changed_types)) |
| 681 syncer::Invalidation::kUnknownVersion, | |
| 682 std::string()) | |
| 683 ).ToString(); | 681 ).ToString(); |
| 684 const std::string& path = | 682 const std::string& path = |
| 685 std::string("chromiumsync/sendnotification?channel=") + | 683 std::string("chromiumsync/sendnotification?channel=") + |
| 686 syncer::kSyncP2PNotificationChannel + "&data=" + data; | 684 syncer::kSyncP2PNotificationChannel + "&data=" + data; |
| 687 ui_test_utils::NavigateToURL(browser(), sync_server_.GetURL(path)); | 685 ui_test_utils::NavigateToURL(browser(), sync_server_.GetURL(path)); |
| 688 ASSERT_EQ("Notification sent", | 686 ASSERT_EQ("Notification sent", |
| 689 UTF16ToASCII(browser()->tab_strip_model()->GetActiveWebContents()-> | 687 UTF16ToASCII(browser()->tab_strip_model()->GetActiveWebContents()-> |
| 690 GetTitle())); | 688 GetTitle())); |
| 691 } | 689 } |
| 692 | 690 |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 833 | 831 |
| 834 void SyncTest::SetProxyConfig(net::URLRequestContextGetter* context_getter, | 832 void SyncTest::SetProxyConfig(net::URLRequestContextGetter* context_getter, |
| 835 const net::ProxyConfig& proxy_config) { | 833 const net::ProxyConfig& proxy_config) { |
| 836 base::WaitableEvent done(false, false); | 834 base::WaitableEvent done(false, false); |
| 837 BrowserThread::PostTask( | 835 BrowserThread::PostTask( |
| 838 BrowserThread::IO, FROM_HERE, | 836 BrowserThread::IO, FROM_HERE, |
| 839 base::Bind(&SetProxyConfigCallback, &done, | 837 base::Bind(&SetProxyConfigCallback, &done, |
| 840 make_scoped_refptr(context_getter), proxy_config)); | 838 make_scoped_refptr(context_getter), proxy_config)); |
| 841 done.Wait(); | 839 done.Wait(); |
| 842 } | 840 } |
| OLD | NEW |