diff options
Diffstat (limited to 'chrome/tools')
-rwxr-xr-x | chrome/tools/automated_ui_test_tools/auto_ui_test_input_generator.py | 302 | ||||
-rwxr-xr-x | chrome/tools/build/win/create_installer_archive.py | 44 | ||||
-rwxr-xr-x | chrome/tools/build/win/dependencies.py | 6 | ||||
-rwxr-xr-x | chrome/tools/build/win/sln_deps.py | 2 | ||||
-rw-r--r-- | chrome/tools/convert_dict/dic_reader.cc | 8 | ||||
-rwxr-xr-x | chrome/tools/extensions/chromium_extension.py | 12 | ||||
-rwxr-xr-x | chrome/tools/extract_actions.py | 2 | ||||
-rwxr-xr-x | chrome/tools/history-viz.py | 8 | ||||
-rwxr-xr-x | chrome/tools/test/smoketests.py | 2 |
9 files changed, 193 insertions, 193 deletions
diff --git a/chrome/tools/automated_ui_test_tools/auto_ui_test_input_generator.py b/chrome/tools/automated_ui_test_tools/auto_ui_test_input_generator.py index 7756028..7e3d3f9 100755 --- a/chrome/tools/automated_ui_test_tools/auto_ui_test_input_generator.py +++ b/chrome/tools/automated_ui_test_tools/auto_ui_test_input_generator.py @@ -4,69 +4,69 @@ """This generates the input file for automated_ui_tests.exe. -We take in a list of possible actions separated by new lines, the number of -commands per file, and the number of actions per command, and generate +We take in a list of possible actions separated by new lines, the number of +commands per file, and the number of actions per command, and generate a single random file, or one or more files containing all possible commands, -or one file with a partial set of possible commands starting at a certain +or one file with a partial set of possible commands starting at a certain command number. -Example usage: - python auto_ui_test_input_generator.py --commands-per-file 50 - --actions-per-command 5 --action-list-file possible_actions.txt +Example usage: + python auto_ui_test_input_generator.py --commands-per-file 50 + --actions-per-command 5 --action-list-file possible_actions.txt --output random_file.txt - - Generates a file called random_file.txt with 50 commands containing 5 actions - each randomly chosen from the list of new line separated actions in + + Generates a file called random_file.txt with 50 commands containing 5 actions + each randomly chosen from the list of new line separated actions in possible_actions.txt - - python auto_ui_test_input_generator.py --commands-per-file 200 + + python auto_ui_test_input_generator.py --commands-per-file 200 --actions-per-command 6 --partial-coverage-from 700 - --action-list-file possible_actions.txt + --action-list-file possible_actions.txt --output partial_coverage.txt - - Generates a file called partial_coverage.txt with 200 commands containing 6 + + Generates a file called partial_coverage.txt with 200 commands containing 6 actions each starting at command #700 and ending at command #899 and chosen from the list of new line separated actions possible_actions.txt - -Options: - --action-list-file input_file_name - Name of file containing possible actions separated by new lines. You can + +Options: + --action-list-file input_file_name + Name of file containing possible actions separated by new lines. You can find supported actions in the automated_ui_tests.h documentation. - - --output output_file_name - Name of XML file that will be outputted for use as input for + + --output output_file_name + Name of XML file that will be outputted for use as input for automated_ui_tests.exe. - - --commands-per-file commands_per_file + + --commands-per-file commands_per_file Number of commands per file. - - --actions-per-command actions_per_command + + --actions-per-command actions_per_command Number of actions per command. - - --full-coverage - If full_coverage flag is set will output as many files as neccesary to cover - every combination of possible actions. Files will be named - output_file_name_1.txt, output_file_name_2.txt, etc... + + --full-coverage + If full_coverage flag is set will output as many files as neccesary to cover + every combination of possible actions. Files will be named + output_file_name_1.txt, output_file_name_2.txt, etc... If --full-coverage is true, --full-coverage-one-file and --partial-coverage-from are ignored. - + --full-coverage-one-file - Just like --full_coverage, but outputs to just one file. - Ignores commands_per_file. This is very likely to cause memory errors on + Just like --full_coverage, but outputs to just one file. + Ignores commands_per_file. This is very likely to cause memory errors on large action sets. If --full coverage-one-file is true, --partial-coverage-from is ignored. - - --partial-coverage-from command_to_start_at - Outputs a part of the full coverage, starting at command number - |command_to_start_at| and ending at command number |command_to_start_at| + - |commands_per_file|. Command numbering starts at 0, and the maximum + + --partial-coverage-from command_to_start_at + Outputs a part of the full coverage, starting at command number + |command_to_start_at| and ending at command number |command_to_start_at| + + |commands_per_file|. Command numbering starts at 0, and the maximum command number is number_of_actions_we_choose_from ^ actions_per_command - 1. If |command_to_start_at| + |commands_per_file| is greater than the maximum command number, then only the commands up to the maximum command number are printed. - - --quiet + + --quiet Silence progress messages. """ @@ -76,30 +76,30 @@ import random import xml.dom.minidom class ComprehensiveListGenerator: - """Generates a comprehensive list of all the ways to choose x combinations + """Generates a comprehensive list of all the ways to choose x combinations from an input list, with replacement. - - Init takes |list_length|, which is the length of the of the combination and + + Init takes |list_length|, which is the length of the of the combination and |source_list|, which is the list we want to choose from. - GetNextPortionOfSourceList() returns a list of length |list_length| with a - portion of the complete list of all combinations or None once all possible + GetNextPortionOfSourceList() returns a list of length |list_length| with a + portion of the complete list of all combinations or None once all possible combinations have been returned. - - Example: + + Example: >>> list_gen = ComprehensiveListGenerator(2, ['a','b','c']) - >>> print list_gen.GetNextPortionOfSourceList() + >>> print list_gen.GetNextPortionOfSourceList() ['a','a'] - >>> print list_gen.GetNextPortionOfSourceList() + >>> print list_gen.GetNextPortionOfSourceList() ['a','b'] - >>> print list_gen.GetNextPortionOfSourceList() + >>> print list_gen.GetNextPortionOfSourceList() ['a','c'] >>> ...print list_gen.GetNextPortionOfSourceList() 6 more times... - >>> print list_gen.GetNextPortionOfSourceList() + >>> print list_gen.GetNextPortionOfSourceList() None >>> list_gen.SetIntegerListToCombinationNumber(2) >>> print list_gen.GetCurrentPortionOfSourceList() ['a','c'] - >>> print list_gen.GetNextPortionOfSourceList() + >>> print list_gen.GetNextPortionOfSourceList() ['b','a'] >>> list_gen.SetIntegerListToCombinationNumber(8) >>> print list_gen.GetCurrentPortionOfSourceList() @@ -107,31 +107,31 @@ class ComprehensiveListGenerator: >>> list_gen.SetIntegerListToCombinationNumber(9) >>> print list_gen.GetCurrentPortionOfSourceList() None - + Attributes: __list_length: Length of the resulting combinations. __source_list: The list we are pulling combinations from. - __integer_list: A list of integers representing which indices of + __integer_list: A list of integers representing which indices of |source_list| to return. """ - + def __init__(self, list_length, source_list): self.__list_length = list_length self.__integer_list = None self.__source_list = source_list - + def SetIntegerListToCombinationNumber(self, combo_number): - """ Sets the integer list to represent the |combo_number|th number in the + """ Sets the integer list to represent the |combo_number|th number in the sequence, counting from 0. - - Args: + + Args: combo_number: Number to set the integer list to represent. - + Returns: Sets integer_list to None and returns False if the combo_number is - out of range (bigger than the maximum number of combinations possible or + out of range (bigger than the maximum number of combinations possible or less than 0) """ - if (combo_number < 0 or + if (combo_number < 0 or combo_number >= len(self.__source_list) ** self.__list_length): self.__integer_list = None return False @@ -147,18 +147,18 @@ class ComprehensiveListGenerator: quotient, remainder = divmod(combo_number, index_max_value) combo_number = quotient self.__integer_list[index] = remainder - + return True - + def __IncrementIntegerListIndex(self, index): - """ Increments the given index of integer_list, rolling over to 0 and - incrementing the a lower index if the index is incremented above the last + """ Increments the given index of integer_list, rolling over to 0 and + incrementing the a lower index if the index is incremented above the last index of source_list - - Args: + + Args: index: The index integer_list to attempt to increment. - - Returns: False if it is impossible to incremement any index in the list + + Returns: False if it is impossible to incremement any index in the list which is less than or equal to the given index. """ self.__integer_list[index] += 1 @@ -175,14 +175,14 @@ class ComprehensiveListGenerator: return False # Successfuly incremented the index, return true. return True - + def __IncrementIntegerList(self): - """ Gets the next integer list in the series by attempting to increment the + """ Gets the next integer list in the series by attempting to increment the final index of integer_list. - + Returns: False if we can't increment any index in the integer_list. """ - + # If the list is empty we just started, so populate it with zeroes. if self.__integer_list == None: self.__integer_list = [] @@ -191,50 +191,50 @@ class ComprehensiveListGenerator: return True else: return self.__IncrementIntegerListIndex(self.__list_length-1) - + def GetCurrentPortionOfSourceList(self): - """ Returns the current portion of source_list corresponding to the + """ Returns the current portion of source_list corresponding to the integer_list - + For example, if our current state is: - integer_list = [0,1,0,2] + integer_list = [0,1,0,2] source_list = ['a','b','c','d'] Then calling GetCurrentPortionOfSourceList() returns: ['a','b','a','c'] - + Returns: None if the integer_list is empty, otherwise a list of length list_length with a combination of elements from source_list """ portion_list = [] if self.__integer_list == None: return None - + for index in range(self.__list_length): portion_list.append(self.__source_list[self.__integer_list[index]]) - + return portion_list - + def GetNextPortionOfSourceList(self): - """ Increments the integer_list and then returns the current portion of + """ Increments the integer_list and then returns the current portion of source_list corresponding to the integer_list. - + This is the only function outside users should be calling. It will advance - to the next combination of elements from source_list, and return it. See + to the next combination of elements from source_list, and return it. See the class documentation for proper use. - - Returns: None if all possible combinations of source_list have previously - been returned. Otherwise a new list of length list_length with a combination + + Returns: None if all possible combinations of source_list have previously + been returned. Otherwise a new list of length list_length with a combination of elements from source_list. """ if self.__IncrementIntegerList(): return self.GetCurrentPortionOfSourceList() else: return None - + class AutomatedTestInputGenerator: - """Creates a random file with with the name |file_name| with + """Creates a random file with with the name |file_name| with the number of commands and actions specified in the command line. - + Attributes: __commands_per_file: Number of commands per file. __actions_per_command: Number of actions per command. @@ -246,7 +246,7 @@ class AutomatedTestInputGenerator: input_file = open(options.input_file_name) actions_list = input_file.readlines() input_file.close() - + self.__commands_per_file = options.commands_per_file self.__actions_per_command = options.actions_per_command self.__actions_list = [action.strip() for action in actions_list] @@ -254,7 +254,7 @@ class AutomatedTestInputGenerator: def __CreateDocument(self): """ Create the starter XML document. - + Returns: A tuple containing the XML document and its root element named "Command List". """ @@ -262,11 +262,11 @@ class AutomatedTestInputGenerator: root_element = doc.createElement("CommandList") doc.appendChild(root_element) return doc, root_element - + def __WriteToOutputFile(self, file_name, output): """Writes |output| to file with name |filename|. Overwriting any pre-existing file. - + Args: file_name: Name of the file to create. output: The string to write to file. @@ -274,15 +274,15 @@ class AutomatedTestInputGenerator: output_file = open(file_name, 'w') output_file.write(output) output_file.close() - + def CreateRandomFile(self, file_name): - """Creates a random file with with the name |file_name| with + """Creates a random file with with the name |file_name| with the number of commands and actions specified in the command line. - - Args: + + Args: file_name - Name of the file to create. - - Return: + + Return: Nothing. """ output_doc, root_element = self.__CreateDocument() @@ -294,18 +294,18 @@ class AutomatedTestInputGenerator: command_element.appendChild(action_element) root_element.appendChild(command_element) self.__WriteToOutputFile(file_name, output_doc.toprettyxml()) - + def __AddCommandToDoc(self, output_doc, root_element, command, command_num): """Adds a given command to the output XML document - - Args: + + Args: output_doc - The output XML document. Used to create elements. - root_element - The root element of the XML document. (What we add the + root_element - The root element of the XML document. (What we add the command to) command - The name of the command element we create and add to the doc. command_num - The number of the command. - - Return: + + Return: Nothing. """ command_element = output_doc.createElement("command") @@ -314,20 +314,20 @@ class AutomatedTestInputGenerator: action_element = output_doc.createElement(action) command_element.appendChild(action_element) root_element.appendChild(command_element) - + def CreateComprehensiveFile(self, file_name, start_command, write_to_end): - """Creates one file containing all or part of the comprehensive list of + """Creates one file containing all or part of the comprehensive list of commands starting at a set command. - - Args: + + Args: file_name - Name of the file to create. start_command - Command number to start at. - write_to_end - If true, writes all remaining commands, starting at - start_command. (If start_command is 0, this would write all - possible commands to one file.) If false, write only + write_to_end - If true, writes all remaining commands, starting at + start_command. (If start_command is 0, this would write all + possible commands to one file.) If false, write only commands_per_file commands starting at start_command - - Return: + + Return: Nothing. """ list_generator = ComprehensiveListGenerator(self.__actions_per_command, @@ -336,80 +336,80 @@ class AutomatedTestInputGenerator: command_counter = start_command end_command = start_command + self.__commands_per_file is_complete = False - # Set the underlying integer representation of the command to the + # Set the underlying integer representation of the command to the # the starting command number. list_generator.SetIntegerListToCombinationNumber(start_command) command = list_generator.GetCurrentPortionOfSourceList() - while (command != None and + while (command != None and (write_to_end == True or command_counter < end_command)): self.__AddCommandToDoc(output_doc, root_element, command, command_counter) command_counter += 1; command = list_generator.GetNextPortionOfSourceList() - - self.__WriteToOutputFile(file_name, output_doc.toprettyxml()) - + + self.__WriteToOutputFile(file_name, output_doc.toprettyxml()) + def CreateComprehensiveFiles(self, file_name): - """Creates a comprehensive coverage of all possible combinations from - action_list of length commands_per_file. Names them |file_name|_1, - |file_name|_2, and so on. - - Args: + """Creates a comprehensive coverage of all possible combinations from + action_list of length commands_per_file. Names them |file_name|_1, + |file_name|_2, and so on. + + Args: file_name - Name of the file to create. - - Return: + + Return: Nothing. """ list_generator = ComprehensiveListGenerator(self.__actions_per_command, self.__actions_list) - + is_complete = False file_counter = 0 # Split the file name so we can include the file number before the extension. base_file_name, extension = os.path.splitext(file_name) command_num = 0 - + while is_complete == False: output_doc, root_element = self.__CreateDocument() file_counter += 1 if self.__is_verbose and file_counter % 200 == 0: print "Created " + str(file_counter) + " files... " - + for i in range(self.__commands_per_file): # Get the next sequence of actions as a list. command = list_generator.GetNextPortionOfSourceList() if command == None: is_complete = True break - + # Parse through the list and add them to the output document as children # of a command element self.__AddCommandToDoc(output_doc, root_element, command, command_num) command_num += 1 - + # Finished the commands for this file, so write it and start on next file. - self.__WriteToOutputFile(base_file_name + "_" + str(file_counter) + + self.__WriteToOutputFile(base_file_name + "_" + str(file_counter) + extension, output_doc.toprettyxml()) - + def ParseCommandLine(): """Parses the command line. - - Return: List of options and their values and a list of arguments which were + + Return: List of options and their values and a list of arguments which were unparsed. """ parser = optparse.OptionParser() parser.set_defaults(full_coverage=False) - parser.add_option("-i", "--action-list-file", dest="input_file_name", - type="string", action="store", default="possible_actions.txt", + parser.add_option("-i", "--action-list-file", dest="input_file_name", + type="string", action="store", default="possible_actions.txt", help="input file with a test of newline separated actions" "which are possible. Default is 'possible_actions.txt'") parser.add_option("-o", "--output", dest="output_file_name", type="string", action="store", default="automated_ui_tests.txt", help="the file to output the command list to") - parser.add_option("-c", "--commands-per-file", dest="commands_per_file", - type="int", action="store", default=500, + parser.add_option("-c", "--commands-per-file", dest="commands_per_file", + type="int", action="store", default=500, help="number of commands per file") - parser.add_option("-a", "--actions-per-command", dest="actions_per_command", - type="int", action="store", default=5, + parser.add_option("-a", "--actions-per-command", dest="actions_per_command", + type="int", action="store", default=5, help="number of actions per command") parser.add_option("-f", "--full-coverage", dest="full_coverage", action="store_true", help="Output files for every possible" @@ -418,14 +418,14 @@ def ParseCommandLine(): action="store_false", dest="is_verbose", default=True, help="don't print progress message while creating files") parser.add_option("-1", "--full-coverage-one-file", - action="store_true", dest="full_coverage_one_file", + action="store_true", dest="full_coverage_one_file", default=False, help="complete coverage all outputted to one file") - parser.add_option("-p", "--partial-coverage-from", dest="start_at_command", - type="int", action="store", default=-1, - help="partial list from the complete coverage, starting at" + parser.add_option("-p", "--partial-coverage-from", dest="start_at_command", + type="int", action="store", default=-1, + help="partial list from the complete coverage, starting at" "command #start_at_command") - + return parser.parse_args() def main(): @@ -445,7 +445,7 @@ def main(): print "Finished writing comprehensive files." elif options.full_coverage_one_file: if options.start_at_command >= 0 and options.is_verbose == True: - print ("Error: Both --full-coverage-one-file present and" + print ("Error: Both --full-coverage-one-file present and" "--partial-coverage-from present, ignoring --partial-coverage-from") if options.is_verbose == True: print "Starting to write comprehensive file:" @@ -455,7 +455,7 @@ def main(): elif options.start_at_command >= 0: if options.is_verbose == True: print "Starting to write partial file:" - test_generator.CreateComprehensiveFile(options.output_file_name, + test_generator.CreateComprehensiveFile(options.output_file_name, options.start_at_command , False) if options.is_verbose == True: print "Finished writing partial file." @@ -463,6 +463,6 @@ def main(): test_generator.CreateRandomFile(options.output_file_name) if options.is_verbose == True: print "Output written to file: " + options.output_file_name - + if __name__ == '__main__': main() diff --git a/chrome/tools/build/win/create_installer_archive.py b/chrome/tools/build/win/create_installer_archive.py index 61579ae..cf6d846 100755 --- a/chrome/tools/build/win/create_installer_archive.py +++ b/chrome/tools/build/win/create_installer_archive.py @@ -5,11 +5,11 @@ """Script to create Chrome Installer archive. - This script is used to create an archive of all the files required for a + This script is used to create an archive of all the files required for a Chrome install in appropriate directory structure. It reads chrome.release - file as input, creates chrome.7z archive, compresses setup.exe and - generates packed_files.txt for mini_installer project. - + file as input, creates chrome.7z archive, compresses setup.exe and + generates packed_files.txt for mini_installer project. + """ import ConfigParser @@ -33,13 +33,13 @@ BSDIFF_EXEC = "bsdiff.exe" VERSION_FILE = "VERSION" PACKED_FILE_COMMENTS = """ // This file is automatically generated by create_installer_archive.py. -// It contains the resource entries that are going to be linked inside -// mini_installer.exe. For each file to be linked there should be two +// It contains the resource entries that are going to be linked inside +// mini_installer.exe. For each file to be linked there should be two // lines: // - The first line contains the output filename (without path) and the -// type of the resource ('BN' means the file is not compressed and +// type of the resource ('BN' means the file is not compressed and // 'BL' means the file is compressed. -// - The second line contains the path to the input file. Uses '/' to +// - The second line contains the path to the input file. Uses '/' to // separate path components. """ @@ -71,7 +71,7 @@ def Readconfig(output_dir, input_file, current_version): """ variables = {} variables['ChromeDir'] = CHROME_DIR - variables['VersionDir'] = os.path.join(variables['ChromeDir'], + variables['VersionDir'] = os.path.join(variables['ChromeDir'], current_version) config = ConfigParser.SafeConfigParser(variables) config.read(input_file) @@ -131,7 +131,7 @@ def CreateArchiveFile(output_dir, staging_dir, current_version, lzma_exec = os.path.join(output_dir, "..", "..", "third_party", "lzma_sdk", "Executable", "7za.exe") archive_file = os.path.join(output_dir, FULL_ARCHIVE_FILE) - cmd = '%s a -t7z "%s" "%s" -mx0' % (lzma_exec, archive_file, + cmd = '%s a -t7z "%s" "%s" -mx0' % (lzma_exec, archive_file, os.path.join(staging_dir, CHROME_DIR)) # There doesnt seem to be any way in 7za.exe to override existing file so # we always delete before creating a new one. @@ -147,7 +147,7 @@ def CreateArchiveFile(output_dir, staging_dir, current_version, if (prev_version_dir): prev_archive_file = os.path.join(prev_version_dir, FULL_ARCHIVE_FILE) patch_file = os.path.join(output_dir, "patch.7z") - cmd = '%s "%s" "%s" "%s"' % (os.path.join(output_dir, BSDIFF_EXEC), + cmd = '%s "%s" "%s" "%s"' % (os.path.join(output_dir, BSDIFF_EXEC), prev_archive_file, archive_file, patch_file) RunSystemCommand(cmd) @@ -158,7 +158,7 @@ def CreateArchiveFile(output_dir, staging_dir, current_version, orig_file = archive_file compressed_archive_file_path = os.path.join(output_dir, archive_file_name) - cmd = '%s a -t7z "%s" "%s" -mx9' % (lzma_exec, compressed_archive_file_path, + cmd = '%s a -t7z "%s" "%s" -mx9' % (lzma_exec, compressed_archive_file_path, orig_file) if os.path.exists(compressed_archive_file_path): os.remove(compressed_archive_file_path) @@ -169,7 +169,7 @@ def CreateArchiveFile(output_dir, staging_dir, current_version, def CompressSetupExec(output_dir): """Compresses setup.exe to reduce size.""" - cmd = 'makecab.exe /V1 /L "%s" "%s"' % (output_dir, + cmd = 'makecab.exe /V1 /L "%s" "%s"' % (output_dir, os.path.join(output_dir, SETUP_EXEC)) RunSystemCommand(cmd) @@ -181,15 +181,15 @@ def GetFileMD5Hash(file): return hash -def CreateResourceInputFile(output_dir, +def CreateResourceInputFile(output_dir, prev_version_dir, archive_file_name): """Creates resource input file (packed_files.txt) for mini_installer project. - + This method checks if we are generating a patch instead of full installer. In case of patch it also checks if setup.exe has changed by comparing its MD5 hash with the MD5 hash of previous setup.exe. If hash values are same setup.exe is not included in packed_files.txt. - + In case of patch we include patch.7z and in case of full installer we include chrome.7z in packed_files.txt. """ @@ -199,13 +199,13 @@ def CreateResourceInputFile(output_dir, prev_hash = GetFileMD5Hash(os.path.join(prev_version_dir, SETUP_EXEC)) if (current_hash == prev_hash): setup_exe_needed = 0 - + if (setup_exe_needed): CompressSetupExec(output_dir) c_setup_file = SETUP_EXEC[:len(SETUP_EXEC) - 1] + "_" - setup_file_entry = "%s\t\tBL\n\"%s\"" % (c_setup_file, + setup_file_entry = "%s\t\tBL\n\"%s\"" % (c_setup_file, os.path.join(output_dir, c_setup_file).replace("\\","/")) - + archive_file_entry = "\n%s\t\tB7\n\"%s\"" % (archive_file_name, os.path.join(output_dir, archive_file_name).replace("\\","/")) output_file = os.path.join(output_dir, MINI_INSTALLER_INPUT_FILE) @@ -231,7 +231,7 @@ def main(options): CopyAllFilesToStagingDir(config, options.distribution, staging_dir, options.output_dir) - + # Name of the archive file built (for example - chrome.7z or # patch-<old_version>-<new_version>.7z or patch-<new_version>.7z archive_file_name = CreateArchiveFile(options.output_dir, staging_dir, @@ -250,11 +250,11 @@ if '__main__' == __name__: help='Name of Chromium Distribution. Optional.') option_parser.add_option('-s', '--skip_rebuild_archive', default="False", help='Skip re-building Chrome.7z archive if it exists.') - option_parser.add_option('-l', '--last_chrome_installer', + option_parser.add_option('-l', '--last_chrome_installer', help='Generate differential installer. The value of this parameter ' + 'specifies the directory that contains base versions of ' + 'setup.exe & chrome.7z.') - option_parser.add_option('-v', '--last_chrome_version', + option_parser.add_option('-v', '--last_chrome_version', help='Version of the previous installer. ' + 'Used only for the purpose of naming archive file. Optional.') diff --git a/chrome/tools/build/win/dependencies.py b/chrome/tools/build/win/dependencies.py index c06f9f3..06ce64c 100755 --- a/chrome/tools/build/win/dependencies.py +++ b/chrome/tools/build/win/dependencies.py @@ -160,7 +160,7 @@ def VerifyDependents(pe_name, dependents, delay_loaded, list_file, verbose): # The dependency files have dependencies in two section - dependents and delay_loaded # Also various distributions of Chromium can have different dependencies. So first # we read generic dependencies ("dependents" and "delay_loaded"). If distribution - # specific dependencies exist (i.e. "dependents_google_chrome" and + # specific dependencies exist (i.e. "dependents_google_chrome" and # "delay_loaded_google_chrome") we use those instead. distribution = DIST_DEFAULT if DIST_ENV_VAR in os.environ.keys(): @@ -170,7 +170,7 @@ def VerifyDependents(pe_name, dependents, delay_loaded, list_file, verbose): dist_dependents = "dependents" + distribution if dist_dependents in scope.keys(): expected_dependents = scope[dist_dependents] - + expected_delay_loaded = scope["delay_loaded"] dist_delay_loaded = "delay_loaded" + distribution if dist_delay_loaded in scope.keys(): @@ -181,7 +181,7 @@ def VerifyDependents(pe_name, dependents, delay_loaded, list_file, verbose): print "\n".join(expected_dependents) print "Expected delayloaded:" print "\n".join(expected_delay_loaded) - + deps_result = Diff(pe_name, "dll", dependents, diff --git a/chrome/tools/build/win/sln_deps.py b/chrome/tools/build/win/sln_deps.py index fecb100..ef7803e 100755 --- a/chrome/tools/build/win/sln_deps.py +++ b/chrome/tools/build/win/sln_deps.py @@ -95,7 +95,7 @@ def main(filename, project_to_scan, reverse): if __name__ == '__main__': usage = "usage: %prog [options] solution [project]" - + description = ("Display the dependencies of a project in human readable" " form. [project] is optional. If omited, all projects are" " listed.") diff --git a/chrome/tools/convert_dict/dic_reader.cc b/chrome/tools/convert_dict/dic_reader.cc index 5ddbee7..6035d23 100644 --- a/chrome/tools/convert_dict/dic_reader.cc +++ b/chrome/tools/convert_dict/dic_reader.cc @@ -43,12 +43,12 @@ void SplitDicLine(const std::string& line, std::vector<std::string>* output) { output->push_back(line.substr(slash_index + 1)); } -// This function reads words from a .dic file, or a .dic_delta file. Note that +// This function reads words from a .dic file, or a .dic_delta file. Note that // we read 'all' the words in the file, irrespective of the word count given // in the first non empty line of a .dic file. Also note that, for a .dic_delta // file, the first line actually does _not_ have the number of words. In order -// to control this, we use the |file_has_word_count_in_the_first_line| -// parameter to tell this method whether the first non empty line in the file +// to control this, we use the |file_has_word_count_in_the_first_line| +// parameter to tell this method whether the first non empty line in the file // contains the number of words or not. If it does, skip the first line. If it // does not, then the first line contains a word. bool PopulateWordSet(WordSet* word_set, FILE* file, AffReader* aff_reader, @@ -141,7 +141,7 @@ bool DicReader::Read(AffReader* aff_reader) { // Add words from the dic file to the word set. // Note that the first line is the word count in the file. - if (!PopulateWordSet(&word_set, file_, aff_reader, "dic", + if (!PopulateWordSet(&word_set, file_, aff_reader, "dic", aff_reader->encoding(), true)) return false; diff --git a/chrome/tools/extensions/chromium_extension.py b/chrome/tools/extensions/chromium_extension.py index 4431b34..81e4662 100755 --- a/chrome/tools/extensions/chromium_extension.py +++ b/chrome/tools/extensions/chromium_extension.py @@ -56,7 +56,7 @@ class ExtensionDir: f = open(os.path.join(self._root, MANIFEST_FILENAME)) manifest = json.load(f) f.close() - + zip_path = path + ".zip" if os.path.exists(zip_path): os.remove(zip_path) @@ -68,7 +68,7 @@ class ExtensionDir: logging.debug("%s: %s" % (arcname, file)) zip.write(file, arcname) zip.close() - + zip = open(zip_path, mode="rb") hash = hashlib.sha256() while True: @@ -77,11 +77,11 @@ class ExtensionDir: break hash.update(buf) zip.close() - + manifest["zip_hash"] = hash.hexdigest() # This is a bit odd - we're actually appending a new zip file to the end - # of the manifest. Believe it or not, this is actually an explicit + # of the manifest. Believe it or not, this is actually an explicit # feature of the zip format, and many zip utilities (this library # and three others I tried) can still read the underlying zip file. if os.path.exists(path): @@ -105,7 +105,7 @@ class ExtensionDir: out.write(buf) zip.close() out.close() - + os.remove(zip_path) logging.info("created extension package %s" % path) @@ -136,7 +136,7 @@ class ExtensionPackage: def Run(): logging.basicConfig(level=logging.INFO, format="[%(levelname)s] %(message)s") - + parser = optparse.OptionParser("usage: %prog --indir=<dir> --outfile=<file>") parser.add_option("", "--indir", help="an input directory where the extension lives") diff --git a/chrome/tools/extract_actions.py b/chrome/tools/extract_actions.py index 8eefbb6..6381976 100755 --- a/chrome/tools/extract_actions.py +++ b/chrome/tools/extract_actions.py @@ -58,7 +58,7 @@ def AddComputedActions(actions): def AddWebKitEditorActions(actions): """Add editor actions from editor_client_impl.cc. - + Arguments: actions: set of actions to add to. """ diff --git a/chrome/tools/history-viz.py b/chrome/tools/history-viz.py index 2f94d9a..ecceee4 100755 --- a/chrome/tools/history-viz.py +++ b/chrome/tools/history-viz.py @@ -40,11 +40,11 @@ class URL: def PrettyPrint(self, include_host=True, include_path=True): """Pretty-print this URL in a form more suitable for the graph. - + This will elide very long paths and potentially puts newlines between parts of long components. include_host and include_path determine whether to include the host and path in the output. - + Returns: the pretty-printed string.""" MAX_LEN = 30 # Maximum length of a line in the output. parts = [] @@ -130,7 +130,7 @@ class SQLite: for line in subproc.stdout: row = line.strip().split('\t') yield row - + def LoadHistory(filename): db = SQLite(filename) @@ -223,7 +223,7 @@ for src, dsts in edges.items(): label.append(text) if len(label) == 0: continue - + edgeattrs = [] # Graphviz attributes for the edge. # If the edge is from the start and the transitions are fishy, make it # display as a dotted line. diff --git a/chrome/tools/test/smoketests.py b/chrome/tools/test/smoketests.py index cb566d4..c96f22f 100755 --- a/chrome/tools/test/smoketests.py +++ b/chrome/tools/test/smoketests.py @@ -145,7 +145,7 @@ def main(options, args): len([x for x in tests if x.startswith('page-cycler')])): print 'Skipping page-cycler tests (no data)' options.nopage_cycler = True - + # Start an httpd if needed. http_tests = [x for x in tests if x.endswith('-http')] if http_tests and not options.nopage_cycler and not options.nohttp: |