Add VbExGetLocalizationCount

VbExGetLocalizationCount is a callback function which is supposed to
return the number of screen locales supported by VbExDisplayScreen.

After this change, we still try to get the number of locales from GBB
first but when it fails, VbExGetLocalizationCount is called. The error
code from VbGbbReadBmpHeader will be masked, similarly to the error from
VbDislayScreenFromGBB.

BUG=chromium:502066
BRANCH=tot
TEST=Tested on Samus. make runtests

Change-Id: I04ef8bf1ea02b1aaa05e65673b57bcea1932d8b0
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/304376
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
Daisuke Nojiri
2015-10-06 17:03:08 -07:00
committed by chrome-bot
parent 27c90708e6
commit be5eca9126
3 changed files with 21 additions and 5 deletions

View File

@@ -149,14 +149,14 @@ static void LocalizationTest(void)
ResetMocks();
cparams.gbb->bmpfv_size = 0;
TEST_EQ(VbGetLocalizationCount(&cparams, &count),
VBERROR_INVALID_GBB, "VbGetLocalizationCount bad gbb");
VBERROR_UNKNOWN, "VbGetLocalizationCount bad gbb");
TEST_EQ(count, 0, " count");
VbApiKernelFree(&cparams);
ResetMocks();
bhdr->signature[0] ^= 0x5a;
TEST_EQ(VbGetLocalizationCount(&cparams, &count),
VBERROR_INVALID_BMPFV, "VbGetLocalizationCount bad bmpfv");
VBERROR_UNKNOWN, "VbGetLocalizationCount bad bmpfv");
VbApiKernelFree(&cparams);
ResetMocks();