| 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 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1040 error.error_description.c_str())); | 1040 error.error_description.c_str())); |
| 1041 path.append(base::StringPrintf("&url=%s", error.url.c_str())); | 1041 path.append(base::StringPrintf("&url=%s", error.url.c_str())); |
| 1042 path.append(base::StringPrintf("&frequency=%d", frequency)); | 1042 path.append(base::StringPrintf("&frequency=%d", frequency)); |
| 1043 | 1043 |
| 1044 ui_test_utils::NavigateToURL(browser(), sync_server_.GetURL(path)); | 1044 ui_test_utils::NavigateToURL(browser(), sync_server_.GetURL(path)); |
| 1045 std::string output = base::UTF16ToASCII( | 1045 std::string output = base::UTF16ToASCII( |
| 1046 browser()->tab_strip_model()->GetActiveWebContents()->GetTitle()); | 1046 browser()->tab_strip_model()->GetActiveWebContents()->GetTitle()); |
| 1047 ASSERT_TRUE(output.find("SetError: 200") != base::string16::npos); | 1047 ASSERT_TRUE(output.find("SetError: 200") != base::string16::npos); |
| 1048 } | 1048 } |
| 1049 | 1049 |
| 1050 void SyncTest::TriggerCreateSyncedBookmarks() { | |
| 1051 ASSERT_TRUE(ServerSupportsErrorTriggering()); | |
| 1052 std::string path = "chromiumsync/createsyncedbookmarks"; | |
| 1053 ui_test_utils::NavigateToURL(browser(), sync_server_.GetURL(path)); | |
| 1054 ASSERT_EQ("Synced Bookmarks", | |
| 1055 base::UTF16ToASCII( | |
| 1056 browser()->tab_strip_model()->GetActiveWebContents()-> | |
| 1057 GetTitle())); | |
| 1058 } | |
| 1059 | |
| 1060 void SyncTest::SetupNetwork(net::URLRequestContextGetter* context_getter) { | 1050 void SyncTest::SetupNetwork(net::URLRequestContextGetter* context_getter) { |
| 1061 base::WaitableEvent done(false, false); | 1051 base::WaitableEvent done(false, false); |
| 1062 BrowserThread::PostTask( | 1052 BrowserThread::PostTask( |
| 1063 BrowserThread::IO, FROM_HERE, | 1053 BrowserThread::IO, FROM_HERE, |
| 1064 base::Bind(&SetupNetworkCallback, &done, | 1054 base::Bind(&SetupNetworkCallback, &done, |
| 1065 make_scoped_refptr(context_getter))); | 1055 make_scoped_refptr(context_getter))); |
| 1066 done.Wait(); | 1056 done.Wait(); |
| 1067 } | 1057 } |
| 1068 | 1058 |
| 1069 void SyncTest::SetProxyConfig(net::URLRequestContextGetter* context_getter, | 1059 void SyncTest::SetProxyConfig(net::URLRequestContextGetter* context_getter, |
| 1070 const net::ProxyConfig& proxy_config) { | 1060 const net::ProxyConfig& proxy_config) { |
| 1071 base::WaitableEvent done(false, false); | 1061 base::WaitableEvent done(false, false); |
| 1072 BrowserThread::PostTask( | 1062 BrowserThread::PostTask( |
| 1073 BrowserThread::IO, FROM_HERE, | 1063 BrowserThread::IO, FROM_HERE, |
| 1074 base::Bind(&SetProxyConfigCallback, &done, | 1064 base::Bind(&SetProxyConfigCallback, &done, |
| 1075 make_scoped_refptr(context_getter), proxy_config)); | 1065 make_scoped_refptr(context_getter), proxy_config)); |
| 1076 done.Wait(); | 1066 done.Wait(); |
| 1077 } | 1067 } |
| 1078 | 1068 |
| 1079 fake_server::FakeServer* SyncTest::GetFakeServer() const { | 1069 fake_server::FakeServer* SyncTest::GetFakeServer() const { |
| 1080 return fake_server_.get(); | 1070 return fake_server_.get(); |
| 1081 } | 1071 } |
| OLD | NEW |