OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/devtools/device/adb/mock_adb_server.h" | 5 #include "chrome/browser/devtools/device/adb/mock_adb_server.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 | 147 |
148 char kSampleWebViewPages[] = "[ {\n" | 148 char kSampleWebViewPages[] = "[ {\n" |
149 " \"description\": \"{\\\"attached\\\":false,\\\"empty\\\":false," | 149 " \"description\": \"{\\\"attached\\\":false,\\\"empty\\\":false," |
150 "\\\"height\\\":1173,\\\"screenX\\\":0,\\\"screenY\\\":0," | 150 "\\\"height\\\":1173,\\\"screenX\\\":0,\\\"screenY\\\":0," |
151 "\\\"visible\\\":true,\\\"width\\\":800}\",\n" | 151 "\\\"visible\\\":true,\\\"width\\\":800}\",\n" |
152 " \"devtoolsFrontendUrl\": \"http://chrome-devtools-frontend.appspot.com/" | 152 " \"devtoolsFrontendUrl\": \"http://chrome-devtools-frontend.appspot.com/" |
153 "serve_rev/@157588/devtools.html?ws=" | 153 "serve_rev/@157588/devtools.html?ws=" |
154 "/devtools/page/3E962D4D-B676-182D-3BE8-FAE7CE224DE7\",\n" | 154 "/devtools/page/3E962D4D-B676-182D-3BE8-FAE7CE224DE7\",\n" |
155 " \"faviconUrl\": \"http://chromium.org/favicon.ico\",\n" | 155 " \"faviconUrl\": \"http://chromium.org/favicon.ico\",\n" |
156 " \"id\": \"3E962D4D-B676-182D-3BE8-FAE7CE224DE7\",\n" | 156 " \"id\": \"3E962D4D-B676-182D-3BE8-FAE7CE224DE7\",\n" |
157 " \"thumbnailUrl\": \"/thumb/3E962D4D-B676-182D-3BE8-FAE7CE224DE7\",\n" | |
158 " \"title\": \"Blink - The Chromium Projects\",\n" | 157 " \"title\": \"Blink - The Chromium Projects\",\n" |
159 " \"type\": \"page\",\n" | 158 " \"type\": \"page\",\n" |
160 " \"url\": \"http://www.chromium.org/blink\",\n" | 159 " \"url\": \"http://www.chromium.org/blink\",\n" |
161 " \"webSocketDebuggerUrl\": \"ws:///devtools/" | 160 " \"webSocketDebuggerUrl\": \"ws:///devtools/" |
162 "page/3E962D4D-B676-182D-3BE8-FAE7CE224DE7\"\n" | 161 "page/3E962D4D-B676-182D-3BE8-FAE7CE224DE7\"\n" |
163 "}, {\n" | 162 "}, {\n" |
164 " \"description\": \"{\\\"attached\\\":true,\\\"empty\\\":true," | 163 " \"description\": \"{\\\"attached\\\":true,\\\"empty\\\":true," |
165 "\\\"screenX\\\":0,\\\"screenY\\\":33,\\\"visible\\\":false}\",\n" | 164 "\\\"screenX\\\":0,\\\"screenY\\\":33,\\\"visible\\\":false}\",\n" |
166 " \"devtoolsFrontendUrl\": \"http://chrome-devtools-frontend.appspot.com/" | 165 " \"devtoolsFrontendUrl\": \"http://chrome-devtools-frontend.appspot.com/" |
167 "serve_rev/@157588/devtools.html?ws=" | 166 "serve_rev/@157588/devtools.html?ws=" |
168 "/devtools/page/44681551-ADFD-2411-076B-3AB14C1C60E2\",\n" | 167 "/devtools/page/44681551-ADFD-2411-076B-3AB14C1C60E2\",\n" |
169 " \"faviconUrl\": \"\",\n" | 168 " \"faviconUrl\": \"\",\n" |
170 " \"id\": \"44681551-ADFD-2411-076B-3AB14C1C60E2\",\n" | 169 " \"id\": \"44681551-ADFD-2411-076B-3AB14C1C60E2\",\n" |
171 " \"thumbnailUrl\": \"/thumb/44681551-ADFD-2411-076B-3AB14C1C60E2\",\n" | |
172 " \"title\": \"More Activity\",\n" | 170 " \"title\": \"More Activity\",\n" |
173 " \"type\": \"page\",\n" | 171 " \"type\": \"page\",\n" |
174 " \"url\": \"about:blank\",\n" | 172 " \"url\": \"about:blank\",\n" |
175 " \"webSocketDebuggerUrl\": \"ws:///devtools/page/" | 173 " \"webSocketDebuggerUrl\": \"ws:///devtools/page/" |
176 "44681551-ADFD-2411-076B-3AB14C1C60E2\"\n" | 174 "44681551-ADFD-2411-076B-3AB14C1C60E2\"\n" |
177 "}]"; | 175 "}]"; |
178 | 176 |
179 static const int kBufferSize = 16*1024; | 177 static const int kBufferSize = 16*1024; |
180 static const uint16_t kAdbPort = 5037; | 178 static const uint16_t kAdbPort = 5037; |
181 | 179 |
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
615 content::RunMessageLoop(); | 613 content::RunMessageLoop(); |
616 } | 614 } |
617 | 615 |
618 void StopMockAdbServer() { | 616 void StopMockAdbServer() { |
619 BrowserThread::PostTaskAndReply(BrowserThread::IO, FROM_HERE, | 617 BrowserThread::PostTaskAndReply(BrowserThread::IO, FROM_HERE, |
620 base::Bind(&StopMockAdbServerOnIOThread), | 618 base::Bind(&StopMockAdbServerOnIOThread), |
621 base::MessageLoop::QuitWhenIdleClosure()); | 619 base::MessageLoop::QuitWhenIdleClosure()); |
622 content::RunMessageLoop(); | 620 content::RunMessageLoop(); |
623 } | 621 } |
624 | 622 |
OLD | NEW |