Ejemplo n.º 1
0
  def testReadResourceIdsFromFile(self):
    f = StringIO('''
// This file is automatically generated by GRIT. Do not edit.

#pragma once

#define IDS_BOOKMARKS_NO_ITEMS 12500
#define IDS_BOOKMARK_BAR_IMPORT_LINK (::ui::AllowlistedResource<12501>(), 12501)
#define IDS_BOOKMARK_X (::ui::AllowlistedResource<12502>(), 12502)
''')
    resources = {}
    gen_predetermined_ids.ReadResourceIdsFromFile(f, resources)
    self.assertEqual({12500: 'IDS_BOOKMARKS_OPEN_ALL',
                      12501: 'IDS_BOOKMARKS_OPEN_ALL_INCOGNITO',
                      12502: 'IDS_BOOKMARK_X'}, resources)
Ejemplo n.º 2
0
    def testReadResourceIdsFromFile(self):
        f = StringIO.StringIO('''
// This file is automatically generated by GRIT. Do not edit.

#pragma once

#define IDS_BOOKMARKS_NO_ITEMS 12500
#define IDS_BOOKMARK_BAR_IMPORT_LINK _Pragma("whitelisted_resource_12501") 12501
#define IDS_BOOKMARK_X __pragma(message("whitelisted_resource_12502")) 12502
''')
        resources = {}
        gen_predetermined_ids.ReadResourceIdsFromFile(f, resources)
        self.assertEqual(
            {
                12500: 'IDS_BOOKMARKS_NO_ITEMS',
                12501: 'IDS_BOOKMARK_BAR_IMPORT_LINK',
                12502: 'IDS_BOOKMARK_X'
            }, resources)