OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/test_url_request_context_getter.h" | 16 #include "chrome/test/base/test_url_request_context_getter.h" |
17 #include "chrome/test/base/testing_browser_process.h" | 17 #include "chrome/test/base/testing_browser_process.h" |
18 #include "chrome/test/base/testing_profile.h" | 18 #include "chrome/test/base/testing_profile.h" |
19 #include "content/test/test_browser_thread.h" | 19 #include "content/test/test_browser_thread.h" |
20 #include "content/test/test_url_fetcher_factory.h" | 20 #include "content/test/test_url_fetcher_factory.h" |
21 #include "net/url_request/url_request_status.h" | 21 #include "net/url_request/url_request_status.h" |
22 #include "testing/gmock/include/gmock/gmock.h" | 22 #include "testing/gmock/include/gmock/gmock.h" |
23 #include "testing/gtest/include/gtest/gtest.h" | 23 #include "testing/gtest/include/gtest/gtest.h" |
24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputElement.h" | 24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputElement.h" |
25 #include "webkit/glue/form_data.h" | 25 #include "webkit/forms/form_data.h" |
26 | 26 |
27 using content::BrowserThread; | 27 using content::BrowserThread; |
28 using webkit_glue::FormData; | 28 using webkit::forms::FormData; |
29 using webkit_glue::FormField; | 29 using webkit::forms::FormField; |
30 using WebKit::WebInputElement; | 30 using WebKit::WebInputElement; |
31 | 31 |
32 namespace { | 32 namespace { |
33 | 33 |
34 class MockAutofillMetrics : public AutofillMetrics { | 34 class MockAutofillMetrics : public AutofillMetrics { |
35 public: | 35 public: |
36 MockAutofillMetrics() {} | 36 MockAutofillMetrics() {} |
37 MOCK_CONST_METHOD1(LogServerQueryMetric, void(ServerQueryMetric metric)); | 37 MOCK_CONST_METHOD1(LogServerQueryMetric, void(ServerQueryMetric metric)); |
38 | 38 |
39 private: | 39 private: |
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
501 mock_metric_logger)); | 501 mock_metric_logger)); |
502 // No responses yet | 502 // No responses yet |
503 EXPECT_EQ(static_cast<size_t>(0), responses_.size()); | 503 EXPECT_EQ(static_cast<size_t>(0), responses_.size()); |
504 | 504 |
505 fetcher = factory.GetFetcherByID(3); | 505 fetcher = factory.GetFetcherByID(3); |
506 ASSERT_TRUE(fetcher); | 506 ASSERT_TRUE(fetcher); |
507 FakeOnURLFetchComplete(fetcher, 200, std::string(responses[0])); | 507 FakeOnURLFetchComplete(fetcher, 200, std::string(responses[0])); |
508 ASSERT_EQ(static_cast<size_t>(1), responses_.size()); | 508 ASSERT_EQ(static_cast<size_t>(1), responses_.size()); |
509 EXPECT_EQ(responses[0], responses_.front().response); | 509 EXPECT_EQ(responses[0], responses_.front().response); |
510 } | 510 } |
OLD | NEW |