author Tsuyoshi Horo <horo@chromium.org>
Wed, 06 Mar 2019 12:33:36 +0000
changeset 464642 5f4503098f271c69d34c5a028f5a5eb909859e79
parent 455262 8dcbc414dda673564951f3a28099643f3a8d1ed6
permissions -rw-r--r--
Bug 1527961 [wpt PR 15372] - Implement Signed Exchange reporting for distributors, a=testonly Automatic update from web-platform-tests Implement Signed Exchange reporting for distributors This CL implements Signed Exchange reporting for distributors. Spec: https://github.com/WICG/webpackage/pull/374 This CL has two success test cases only. I will add more failure test cases in another CL. Bug: 910516 Change-Id: I31a6e629073970e03a93d2379be1ae63ef6adf6b Reviewed-on: https://chromium-review.googlesource.com/c/1468855 Commit-Queue: Tsuyoshi Horo <horo@chromium.org> Reviewed-by: Christian Dullweber <dullweber@chromium.org> Reviewed-by: Kinuko Yasuda <kinuko@chromium.org> Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Reviewed-by: Kunihiko Sakamoto <ksakamoto@chromium.org> Reviewed-by: Eric Orth <ericorth@chromium.org> Cr-Commit-Position: refs/heads/master@{#634161} -- wpt-commits: 66dbfd0ae579135db73772c534879c51f6dbc674 wpt-pr: 15372

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

from __future__ import absolute_import, print_function
import json
import os
import shlex
import subprocess
import sys

old_bytecode = sys.dont_write_bytecode
sys.dont_write_bytecode = True

path = os.path.abspath(os.path.join(os.path.dirname(__file__), 'mach'))

# If mach is not here, we're on the objdir go to the srcdir.
if not os.path.exists(path):
    with open(os.path.join(os.path.dirname(__file__), 'mozinfo.json')) as info:
        config = json.loads(info.read())
    path = os.path.join(config['topsrcdir'], 'mach')

sys.dont_write_bytecode = old_bytecode

def _is_likely_cpp_header(filename):
    if not filename.endswith('.h'):
        return False

    if filename.endswith('Inlines.h') or filename.endswith('-inl.h'):
        return True

    cpp_file = filename[:-1] + 'cpp'
    return os.path.exists(cpp_file)

def FlagsForFile(filename):
    output = subprocess.check_output([path, 'compileflags', filename])
    output = output.decode('utf-8')

    flag_list = shlex.split(output)

    # This flag is added by Fennec for android build and causes ycmd to fail to parse the file.
    # Removing this flag is a workaround until ycmd starts to handle this flag properly.
    # https://github.com/Valloric/YouCompleteMe/issues/1490
    final_flags = [x for x in flag_list if not x.startswith('-march=armv')]

    if _is_likely_cpp_header(filename):
        final_flags += ["-x", "c++"]

    return {
        'flags': final_flags,
        'do_cache': True

if __name__ == '__main__':