| 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 "extensions/browser/api/declarative_webrequest/webrequest_action.h" | 5 #include "extensions/browser/api/declarative_webrequest/webrequest_action.h" |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/json/json_file_value_serializer.h" | 8 #include "base/json/json_file_value_serializer.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 } // namespace | 69 } // namespace |
| 70 | 70 |
| 71 namespace keys = declarative_webrequest_constants; | 71 namespace keys = declarative_webrequest_constants; |
| 72 | 72 |
| 73 class WebRequestActionWithThreadsTest : public testing::Test { | 73 class WebRequestActionWithThreadsTest : public testing::Test { |
| 74 public: | 74 public: |
| 75 WebRequestActionWithThreadsTest() | 75 WebRequestActionWithThreadsTest() |
| 76 : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP) {} | 76 : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP) {} |
| 77 | 77 |
| 78 protected: | 78 protected: |
| 79 virtual void SetUp() OVERRIDE; | 79 virtual void SetUp() override; |
| 80 | 80 |
| 81 // Creates a URL request for URL |url_string|, and applies the actions from | 81 // Creates a URL request for URL |url_string|, and applies the actions from |
| 82 // |action_set| as if they were triggered by the extension with | 82 // |action_set| as if they were triggered by the extension with |
| 83 // |extension_id| during |stage|. | 83 // |extension_id| during |stage|. |
| 84 bool ActionWorksOnRequest(const char* url_string, | 84 bool ActionWorksOnRequest(const char* url_string, |
| 85 const std::string& extension_id, | 85 const std::string& extension_id, |
| 86 const WebRequestActionSet* action_set, | 86 const WebRequestActionSet* action_set, |
| 87 RequestStage stage); | 87 RequestStage stage); |
| 88 | 88 |
| 89 // Expects a JSON description of an |action| requiring <all_urls> host | 89 // Expects a JSON description of an |action| requiring <all_urls> host |
| (...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 583 for (WebRequestActionSet::Actions::const_iterator it = | 583 for (WebRequestActionSet::Actions::const_iterator it = |
| 584 action_set->actions().begin(); | 584 action_set->actions().begin(); |
| 585 it != action_set->actions().end(); | 585 it != action_set->actions().end(); |
| 586 ++it) { | 586 ++it) { |
| 587 EXPECT_EQ(kExpectedNames[index], (*it)->GetName()); | 587 EXPECT_EQ(kExpectedNames[index], (*it)->GetName()); |
| 588 ++index; | 588 ++index; |
| 589 } | 589 } |
| 590 } | 590 } |
| 591 | 591 |
| 592 } // namespace extensions | 592 } // namespace extensions |
| OLD | NEW |