Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Side by Side Diff: chrome/browser/extensions/api/declarative_webrequest/webrequest_action_unittest.cc

Issue 15666005: Make WebRequestAction::GetName a pure virtual function (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/extensions/api/declarative_webrequest/webrequest_action.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "chrome/browser/extensions/api/declarative_webrequest/webrequest_action .h" 5 #include "chrome/browser/extensions/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 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 " \"instanceType\": \"declarativeWebRequest.RedirectToTransparentImage\"" 535 " \"instanceType\": \"declarativeWebRequest.RedirectToTransparentImage\""
536 "}," 536 "},"
537 "{" 537 "{"
538 " \"instanceType\": \"declarativeWebRequest.RedirectToEmptyDocument\"" 538 " \"instanceType\": \"declarativeWebRequest.RedirectToEmptyDocument\""
539 "}," 539 "},"
540 "{" 540 "{"
541 " \"instanceType\": \"declarativeWebRequest.IgnoreRules\"," 541 " \"instanceType\": \"declarativeWebRequest.IgnoreRules\","
542 " \"lowerPriorityThan\": 123," 542 " \"lowerPriorityThan\": 123,"
543 " \"hasTag\": \"some_tag\"" 543 " \"hasTag\": \"some_tag\""
544 "}]"; 544 "}]";
545 const char* kExpectedNames[] = {
546 "declarativeWebRequest.RedirectRequest",
547 "declarativeWebRequest.RedirectByRegEx",
548 "declarativeWebRequest.SetRequestHeader",
549 "declarativeWebRequest.RemoveRequestHeader",
550 "declarativeWebRequest.AddResponseHeader",
551 "declarativeWebRequest.RemoveResponseHeader",
552 "declarativeWebRequest.SendMessageToExtension",
553 "declarativeWebRequest.AddRequestCookie",
554 "declarativeWebRequest.AddResponseCookie",
555 "declarativeWebRequest.EditRequestCookie",
556 "declarativeWebRequest.EditResponseCookie",
557 "declarativeWebRequest.RemoveRequestCookie",
558 "declarativeWebRequest.RemoveResponseCookie",
559 "declarativeWebRequest.CancelRequest",
560 "declarativeWebRequest.RedirectToTransparentImage",
561 "declarativeWebRequest.RedirectToEmptyDocument",
562 "declarativeWebRequest.IgnoreRules",
563 };
545 scoped_ptr<WebRequestActionSet> action_set(CreateSetOfActions(kActions)); 564 scoped_ptr<WebRequestActionSet> action_set(CreateSetOfActions(kActions));
565 ASSERT_EQ(arraysize(kExpectedNames), action_set->actions().size());
566 size_t index = 0;
546 for (WebRequestActionSet::Actions::const_iterator it = 567 for (WebRequestActionSet::Actions::const_iterator it =
547 action_set->actions().begin(); 568 action_set->actions().begin();
548 it != action_set->actions().end(); 569 it != action_set->actions().end();
549 ++it) { 570 ++it) {
550 EXPECT_THAT((*it)->GetName(), HasSubstr("declarativeWebRequest.")); 571 EXPECT_EQ(kExpectedNames[index], (*it)->GetName());
572 ++index;
551 } 573 }
552 } 574 }
553 575
554 } // namespace extensions 576 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/declarative_webrequest/webrequest_action.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698