Index: testing_support/patches_data.py |
diff --git a/testing_support/patches_data.py b/testing_support/patches_data.py |
index b70f55ba351b65c54786b4ecf535b0cedd1df8cd..1e468666e9ddba58c753e0261e4a838561713996 100644 |
--- a/testing_support/patches_data.py |
+++ b/testing_support/patches_data.py |
@@ -54,12 +54,63 @@ class RAW(object): |
'--- chrome/file.cc\tbar\n' |
'+++ /dev/null\tfoo\n') |
+ DELETE2 = ( |
+ 'Index: browser/extensions/extension_sidebar_api.cc\n' |
+ '===================================================================\n' |
+ '--- browser/extensions/extension_sidebar_api.cc\t(revision 116830)\n' |
+ '+++ browser/extensions/extension_sidebar_api.cc\t(working copy)\n' |
+ '@@ -1,19 +0,0 @@\n' |
+ '-// Copyright (c) 2011 The Chromium Authors. All rights reserved.\n' |
+ '-// Use of this source code is governed by a BSD-style license that\n' |
+ '-// found in the LICENSE file.\n' |
+ '-\n' |
+ '-#include "base/command_line.h"\n' |
+ '-#include "chrome/browser/extensions/extension_apitest.h"\n' |
+ '-#include "chrome/common/chrome_switches.h"\n' |
+ '-\n' |
+ '-class SidebarApiTest : public ExtensionApiTest {\n' |
+ '- public:\n' |
+ '- void SetUpCommandLine(CommandLine* command_line) {\n' |
+ '- ExtensionApiTest::SetUpCommandLine(command_line);\n' |
+ '- command_line->AppendSwitch(switches::Bleh);\n' |
+ '- }\n' |
+ '-};\n' |
+ '-\n' |
+ '-IN_PROC_BROWSER_TEST_F(SidebarApiTest, Sidebar) {\n' |
+ '- ASSERT_TRUE(RunExtensionTest("sidebar")) << message_;\n' |
+ '-}\n') |
+ |
# http://codereview.chromium.org/api/7530007/5001 |
# http://codereview.chromium.org/download/issue7530007_5001_4011.diff |
CRAP_ONLY = ( |
'Index: scripts/master/factory/skia/__init__.py\n' |
'===================================================================\n') |
+ TWO_HUNKS = ( |
+ 'Index: chrome/app/generated_resources.grd\n' |
+ '===================================================================\n' |
+ '--- chrome/app/generated_resources.grd\t(revision 116830)\n' |
+ '+++ chrome/app/generated_resources.grd\t(working copy)\n' |
+ '@@ -4169,9 +4169,6 @@\n' |
+ ' <message name="IDS_EXTENSION_LOAD_OPTIONS_PAGE_FAILED" desc="">\n' |
+ ' Could not load options page \'<ph name="OPTIONS_PAGE">$1<ex....\n' |
+ ' </message>\n' |
+ '- <message name="IDS_EXTENSION_LOAD_SIDEBAR_PAGE_FAILED" desc="">\n' |
+ '- Could not load sidebar page \'<ph name="SIDEBAR_PAGE">$1<e...\n' |
+ '- </message>\n' |
+ ' <if expr="is_win">\n' |
+ ' <message name="IDS_EXTENSION_UNPACK_FAILED" desc="On wind...\n' |
+ ' Can not unpack extension. To safely unpack an extensio...\n' |
+ '@@ -5593,9 +5590,6 @@\n' |
+ ' <message name="IDS_ACCNAME_WEB_CONTENTS" desc="The acces...\n' |
+ ' Web Contents\n' |
+ ' </message>\n' |
+ '- <message name="IDS_ACCNAME_SIDE_BAR" desc="The acces...\n' |
+ '- Sidebar\n' |
+ '- </message>\n' |
+ ' \n' |
+ ' <!-- Browser Hung Plugin Detector -->\n' |
+ ' <message name="IDS_UNKNOWN_PLUGIN_NAME" ...\n') |
class GIT(object): |
"""Sample patches generated by git diff.""" |
@@ -206,3 +257,51 @@ class GIT(object): |
'diff --git a/git_cl/git-cl b/git_cl/git-cl\n' |
'old mode 100644\n' |
'new mode 100755\n') |
+ |
+ FOUR_HUNKS = ( |
+ 'Index: presubmit_support.py\n' |
+ 'diff --git a/presubmit_support.py b/presubmit_support.py\n' |
+ 'index 52416d3f..d56512f2 100755\n' |
+ '--- a/presubmit_support.py\n' |
+ '+++ b/presubmit_support.py\n' |
+ '@@ -558,6 +558,7 @@ class SvnAffectedFile(AffectedFile):\n' |
+ ' AffectedFile.__init__(self, *args, **kwargs)\n' |
+ ' self._server_path = None\n' |
+ ' self._is_text_file = None\n' |
+ '+ self._diff = None\n' |
+ ' \n' |
+ ' def ServerPath(self):\n' |
+ ' if self._server_path is None:\n' |
+ '@@ -598,8 +599,10 @@ class SvnAffectedFile(AffectedFile):\n' |
+ ' return self._is_text_file\n' |
+ ' \n' |
+ ' def GenerateScmDiff(self):\n' |
+ '- return scm.SVN.GenerateDiff(\n' |
+ '- [self.LocalPath()], self._local_root, False, None)\n' |
+ '+ if self._diff is None:\n' |
+ '+ self._diff = scm.SVN.GenerateDiff(\n' |
+ '+ [self.LocalPath()], self._local_root, False, None)\n' |
+ '+ return self._diff\n' |
+ ' \n' |
+ ' \n' |
+ ' class GitAffectedFile(AffectedFile):\n' |
+ '@@ -611,6 +614,7 @@ class GitAffectedFile(AffectedFile):\n' |
+ ' AffectedFile.__init__(self, *args, **kwargs)\n' |
+ ' self._server_path = None\n' |
+ ' self._is_text_file = None\n' |
+ '+ self._diff = None\n' |
+ ' \n' |
+ ' def ServerPath(self):\n' |
+ ' if self._server_path is None:\n' |
+ '@@ -645,7 +649,10 @@ class GitAffectedFile(AffectedFile):\n' |
+ ' return self._is_text_file\n' |
+ ' \n' |
+ ' def GenerateScmDiff(self):\n' |
+ '- return scm.GIT.GenerateDiff(self._local_root, files=[self.Lo...\n' |
+ '+ if self._diff is None:\n' |
+ '+ self._diff = scm.GIT.GenerateDiff(\n' |
+ '+ self._local_root, files=[self.LocalPath(),])\n' |
+ '+ return self._diff\n' |
+ ' \n' |
+ ' \n' |
+ ' class Change(object):\n') |