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 <list> | 5 #include <list> |
6 | 6 |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "base/test/test_timeouts.h" | 9 #include "base/test/test_timeouts.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
11 #include "chrome/browser/autofill/autofill_download.h" | 11 #include "chrome/browser/autofill/autofill_download.h" |
12 #include "chrome/browser/autofill/autofill_field.h" | 12 #include "chrome/browser/autofill/autofill_field.h" |
13 #include "chrome/browser/autofill/autofill_metrics.h" | 13 #include "chrome/browser/autofill/autofill_metrics.h" |
14 #include "chrome/browser/autofill/autofill_type.h" | 14 #include "chrome/browser/autofill/autofill_type.h" |
15 #include "chrome/browser/autofill/form_structure.h" | 15 #include "chrome/browser/autofill/form_structure.h" |
16 #include "chrome/test/base/testing_browser_process.h" | 16 #include "chrome/test/base/testing_browser_process.h" |
17 #include "chrome/test/base/testing_profile.h" | 17 #include "chrome/test/base/testing_profile.h" |
| 18 #include "content/public/common/form_data.h" |
18 #include "content/public/test/test_browser_thread.h" | 19 #include "content/public/test/test_browser_thread.h" |
19 #include "net/url_request/test_url_fetcher_factory.h" | 20 #include "net/url_request/test_url_fetcher_factory.h" |
20 #include "net/url_request/url_request_status.h" | 21 #include "net/url_request/url_request_status.h" |
21 #include "testing/gmock/include/gmock/gmock.h" | 22 #include "testing/gmock/include/gmock/gmock.h" |
22 #include "testing/gtest/include/gtest/gtest.h" | 23 #include "testing/gtest/include/gtest/gtest.h" |
23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputElement.h" | 24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputElement.h" |
24 #include "webkit/forms/form_data.h" | |
25 | 25 |
26 using content::BrowserThread; | 26 using content::BrowserThread; |
27 using webkit::forms::FormData; | 27 using content::FormData; |
28 using webkit::forms::FormField; | 28 using content::FormField; |
29 using WebKit::WebInputElement; | 29 using WebKit::WebInputElement; |
30 | 30 |
31 namespace { | 31 namespace { |
32 | 32 |
33 class MockAutofillMetrics : public AutofillMetrics { | 33 class MockAutofillMetrics : public AutofillMetrics { |
34 public: | 34 public: |
35 MockAutofillMetrics() {} | 35 MockAutofillMetrics() {} |
36 MOCK_CONST_METHOD1(LogServerQueryMetric, void(ServerQueryMetric metric)); | 36 MOCK_CONST_METHOD1(LogServerQueryMetric, void(ServerQueryMetric metric)); |
37 | 37 |
38 private: | 38 private: |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 mock_metric_logger)); | 498 mock_metric_logger)); |
499 // No responses yet | 499 // No responses yet |
500 EXPECT_EQ(static_cast<size_t>(0), responses_.size()); | 500 EXPECT_EQ(static_cast<size_t>(0), responses_.size()); |
501 | 501 |
502 fetcher = factory.GetFetcherByID(3); | 502 fetcher = factory.GetFetcherByID(3); |
503 ASSERT_TRUE(fetcher); | 503 ASSERT_TRUE(fetcher); |
504 FakeOnURLFetchComplete(fetcher, 200, std::string(responses[0])); | 504 FakeOnURLFetchComplete(fetcher, 200, std::string(responses[0])); |
505 ASSERT_EQ(static_cast<size_t>(1), responses_.size()); | 505 ASSERT_EQ(static_cast<size_t>(1), responses_.size()); |
506 EXPECT_EQ(responses[0], responses_.front().response); | 506 EXPECT_EQ(responses[0], responses_.front().response); |
507 } | 507 } |
OLD | NEW |