| OLD | NEW | 
|    1 #!/usr/bin/env python |    1 #!/usr/bin/env python | 
|    2 # Copyright (c) 2011 Google Inc. All rights reserved. |    2 # Copyright (c) 2011 Google Inc. All rights reserved. | 
|    3 # |    3 # | 
|    4 # Redistribution and use in source and binary forms, with or without |    4 # Redistribution and use in source and binary forms, with or without | 
|    5 # modification, are permitted provided that the following conditions are |    5 # modification, are permitted provided that the following conditions are | 
|    6 # met: |    6 # met: | 
|    7 #  |    7 #  | 
|    8 #     * Redistributions of source code must retain the above copyright |    8 #     * Redistributions of source code must retain the above copyright | 
|    9 # notice, this list of conditions and the following disclaimer. |    9 # notice, this list of conditions and the following disclaimer. | 
|   10 #     * Redistributions in binary form must reproduce the above |   10 #     * Redistributions in binary form must reproduce the above | 
| (...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  444     output_path = arg_options.o |  444     output_path = arg_options.o | 
|  445     output_file = open(output_path, "w") |  445     output_file = open(output_path, "w") | 
|  446  |  446  | 
|  447     domains = [] |  447     domains = [] | 
|  448     baseline_domains = [] |  448     baseline_domains = [] | 
|  449     version = load_domains_and_baselines(arg_values[0], domains, baseline_domain
     s) |  449     version = load_domains_and_baselines(arg_values[0], domains, baseline_domain
     s) | 
|  450     if len(arg_values) > 1: |  450     if len(arg_values) > 1: | 
|  451         load_domains_and_baselines(arg_values[1], domains, baseline_domains) |  451         load_domains_and_baselines(arg_values[1], domains, baseline_domains) | 
|  452  |  452  | 
|  453     expected_errors = [ |  453     expected_errors = [ | 
|  454         "Debugger.globalObjectCleared: event has been removed" |  454         "Debugger.globalObjectCleared: event has been removed", | 
 |  455         "Runtime.executionContextCreated.context parameter->Runtime.ExecutionCon
     textDescription.frameId: required property has been removed" | 
|  455     ] |  456     ] | 
|  456  |  457  | 
|  457     errors = compare_schemas(baseline_domains, domains, False) |  458     errors = compare_schemas(baseline_domains, domains, False) | 
|  458     unexpected_errors = [] |  459     unexpected_errors = [] | 
|  459     for i in range(len(errors)): |  460     for i in range(len(errors)): | 
|  460         if errors[i] not in expected_errors: |  461         if errors[i] not in expected_errors: | 
|  461             unexpected_errors.append(errors[i]) |  462             unexpected_errors.append(errors[i]) | 
|  462     if len(unexpected_errors) > 0: |  463     if len(unexpected_errors) > 0: | 
|  463         sys.stderr.write("  Compatibility checks FAILED\n") |  464         sys.stderr.write("  Compatibility checks FAILED\n") | 
|  464         for error in unexpected_errors: |  465         for error in unexpected_errors: | 
|  465             sys.stderr.write( "    %s\n" % error) |  466             sys.stderr.write( "    %s\n" % error) | 
|  466         return 1 |  467         return 1 | 
|  467  |  468  | 
|  468     if arg_options.show_changes: |  469     if arg_options.show_changes: | 
|  469         changes = compare_schemas(domains, baseline_domains, True) |  470         changes = compare_schemas(domains, baseline_domains, True) | 
|  470         if len(changes) > 0: |  471         if len(changes) > 0: | 
|  471             print "  Public changes since %s:" % version |  472             print "  Public changes since %s:" % version | 
|  472             for change in changes: |  473             for change in changes: | 
|  473                 print "    %s" % change |  474                 print "    %s" % change | 
|  474  |  475  | 
|  475     json.dump({"version": version, "domains": domains}, output_file, indent=4, s
     ort_keys=False, separators=(',', ': ')) |  476     json.dump({"version": version, "domains": domains}, output_file, indent=4, s
     ort_keys=False, separators=(',', ': ')) | 
|  476     output_file.close() |  477     output_file.close() | 
|  477  |  478  | 
|  478 if __name__ == '__main__': |  479 if __name__ == '__main__': | 
|  479     sys.exit(main()) |  480     sys.exit(main()) | 
| OLD | NEW |