| 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 | 57 |
| 58 return matches_; | 58 return matches_; |
| 59 } | 59 } |
| 60 | 60 |
| 61 void FindReply(WebContents* web_contents, | 61 void FindReply(WebContents* web_contents, |
| 62 int request_id, | 62 int request_id, |
| 63 int number_of_matches, | 63 int number_of_matches, |
| 64 const gfx::Rect& selection_rect, | 64 const gfx::Rect& selection_rect, |
| 65 int active_match_ordinal, | 65 int active_match_ordinal, |
| 66 bool final_update) override { | 66 bool final_update) override { |
| 67 matches_ = number_of_matches; | 67 if (final_update) { |
| 68 run_loop_.Quit(); | 68 matches_ = number_of_matches; |
| 69 run_loop_.Quit(); |
| 70 } |
| 69 } | 71 } |
| 70 | 72 |
| 71 static int global_request_id; | 73 static int global_request_id; |
| 72 | 74 |
| 73 private: | 75 private: |
| 74 std::string search_; | 76 std::string search_; |
| 75 int matches_; | 77 int matches_; |
| 76 base::RunLoop run_loop_; | 78 base::RunLoop run_loop_; |
| 77 | 79 |
| 78 DISALLOW_COPY_AND_ASSIGN(FindTrackingDelegate); | 80 DISALLOW_COPY_AND_ASSIGN(FindTrackingDelegate); |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 | 470 |
| 469 // Make sure that URLs of both frames are present | 471 // Make sure that URLs of both frames are present |
| 470 // (note that these are single-line regexes). | 472 // (note that these are single-line regexes). |
| 471 EXPECT_THAT( | 473 EXPECT_THAT( |
| 472 mhtml, | 474 mhtml, |
| 473 ContainsRegex("Content-Location:.*/frame_tree/page_with_one_frame.html")); | 475 ContainsRegex("Content-Location:.*/frame_tree/page_with_one_frame.html")); |
| 474 EXPECT_THAT(mhtml, ContainsRegex("Content-Location:.*/title1.html")); | 476 EXPECT_THAT(mhtml, ContainsRegex("Content-Location:.*/title1.html")); |
| 475 } | 477 } |
| 476 | 478 |
| 477 } // namespace content | 479 } // namespace content |
| OLD | NEW |